- Code: Select all
RewriteEngine on
RewriteCond ## only rewrite if ^folder/(.*)?$
RewriteRule ^folder/(lang)/(.*)?$ /folder/index.php?lang=$1
The rewrite rule above is a simplified version of the rewrite rule that I'm using. I've verified that the rewrite rule itself works. I need help coming up with a rewrite condition that does what I specified above.
I realize this is somewhat redundant but I've found that just having the rewrite rule isn't enough. With just the rewrite rule, I am unable to get ErrorDocuments to trigger. It always tries to rewrite the URL. Am missing something or is there an easier/better way to do this?
I'm sorry if this seems somewhat stupid but I've been having a horrible time getting this to wrok. Any help would be greatly appreciated. Thanks in advance!