Need help with a rewrite condition

Discuss practical ways rearrange URLs using mod_rewrite.

Need help with a rewrite condition

Postby NeuralClone » Fri Jun 03, 2005 9:23 am

What I want to do:

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!
NeuralClone
 
Posts: 1
Joined: Fri Jun 03, 2005 9:18 am

Postby Caterham » Thu Jun 09, 2005 10:39 am

Yes, the Cond. redundant.

I am unable to get ErrorDocuments to trigger.
Which path(s)?
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 24 guests

cron