Forum Moderators: open
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.mysite.com$ [NC]
RewriteRule ^(.*)$ [mysite.com...] [L,R=301]
But it's not working.
Kindly suggest. I am wondering.
(which i assume you are using)
the code you have written is for .htaccess
as regards the comments about ISAPI_Rewrite
it is a component that needs to be installed on the server, if you are on a shared hosting environment then i highly doubt you would be able to do it.
Do you know which version of ISAPI_Rewrite they have?
Where did you place your rewrite code. Did you save it to a file on your web space? If so, where did you save it and what was the name of the file?
you cannot use .htaccess on an iis web server.
Actually you can. Version 3.0 of ISAPI_Rewrite uses the .htaccess method. ;)
If you are using Version 2.0 and the .ini method, the code for permanently redirecting non www to www is...
RewriteCond Host: ^example\.com
RewriteRule (.*) http\://www\.example\.com$1 [I,RP]
yes i understand that pageoneresults, however i said that you need to install the ISAPI_Rewrite component.
without this component then you cannot.
with reference to ashis06, if you are on a iis webserver i doubt very much that the component is installed unless the host company advertises it on their webpage, as this is a very good feature to have, i doubt they would instal it without shouting about it... however you need to ask them.
if you are running asp pages on an apache webserver then i imagine .htaccess works if it is enabled