Reputation: 3
My server provides the default redirection from www.test.com to test.com I want to remove the redirection for one specific file 'abc.php' there. How to go about it?
The default redirection provided in the .htaccess file is:
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
</IfModule>
Upvotes: 0
Views: 34
Reputation: 2414
Like this (for abc.php):
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteCond %{REQUEST_URI} !^(.*/)?abc\.php$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
</IfModule>
Upvotes: 1