mbannonb
02-08-2011, 02:00 AM
Hi,
I'm trying to get my .htaccess file to redirect correctly.
Calling from the browser, http://somedomain.com/deals/
successfully triggers a behind the scenes rewrite:
RewriteCond %{REQUEST_URI} ^/deals/$ [NC]
RewriteRule ^deals/ /offers/listing.php?query=1 [L]
And that works. The server internally refers to offers/listing.php.
However, I want to set up the reverse. If a browser calls http://somedomain.com/offers/listing.php I want to do a 301 redirect to /deals/
RewriteCond %{REQUEST_URI} ^/offers/listing.php.*$ [NC]
RewriteRule ^.+ /deals/ [R=301,L]
I can't get that last bit to work. listing.php just loads.
Any help is appreciated!
One more thing, the "L" in the first rewrite rule should keep the rest of the htaccess from proscessing, correct?
I'm trying to get my .htaccess file to redirect correctly.
Calling from the browser, http://somedomain.com/deals/
successfully triggers a behind the scenes rewrite:
RewriteCond %{REQUEST_URI} ^/deals/$ [NC]
RewriteRule ^deals/ /offers/listing.php?query=1 [L]
And that works. The server internally refers to offers/listing.php.
However, I want to set up the reverse. If a browser calls http://somedomain.com/offers/listing.php I want to do a 301 redirect to /deals/
RewriteCond %{REQUEST_URI} ^/offers/listing.php.*$ [NC]
RewriteRule ^.+ /deals/ [R=301,L]
I can't get that last bit to work. listing.php just loads.
Any help is appreciated!
One more thing, the "L" in the first rewrite rule should keep the rest of the htaccess from proscessing, correct?