Forum Moderators: phranque
I tried this but it is not working:
RewriteEngine on
RewriteCond %{REQUEST_URI} ao/BackOffice$
RewriteRule ^(.*)\.php$ [example.com...] [R=302,L]
Someone can help me?
[edited by: jdMorgan at 5:34 pm (utc) on Sep. 22, 2004]
[edit reason] Removed specifics per TOS [/edit]
Welcome to WebmasterWorld! Please review our Terms of Service and the Apache Forum charter.
The problem is that your code says to do the redirect *IF* the requested page matches ao/BackOffice. What you probably want to do is to redirect if the requested page *DOES NOT* match ao/BackOffice. In mod_rewrite, the negation operator is "!", so just add that to your RewriteCond:
RewriteEngine on
RewriteCond %{REQUEST_URI} [b]![/b]ao/BackOffice
RewriteRule \.php$ http://example.com/ao/index.html [R=302,L]
Jim
Do you have any other working RewriteRules? If not, then you may need to add a line to the code:
[b]Options +FollowSymLinks[/b]
RewriteEngine on
RewriteCond %{REQUEST_URI} !BackOffice
RewriteRule \.php$ http://example.com/ao/index.html [R=302,L]
There is no mod_rewrite "debugger." However, your server error logs will often contain information that is useful in getting your code to work.
Jim