No access to localhost after non www to www

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 1
Joined: 25 Jun 2012, 11:04

No access to localhost after non www to www

25 Jun 2012, 11:12

Hi,

I use the code from the examples Page to redirect non www to www.
Works perfect, but unfortunately any attempt to access a page using localhost or 127.0.0.1 is denied by the server.

Second question: I have to code in the conf file and also some rules in a htaccess file. Should i move everything into the conf file?

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: No access to localhost after non www to www

26 Jun 2012, 04:21

"but unfortunately any attempt to access a page using localhost or 127.0.0.1 is denied by the server."
- This is actually normal behavior. Use the following cond before the rule to exclude localhost from being rewritten:

RewriteCond %{HTTP_HOST} ^(?:localhost|127.0.0.1)$

"I have to code in the conf file and also some rules in a htaccess file. Should i move everything into the conf file?"
- it depends. If you want the rules to be applied to all sites on the server, put them into httpd.conf. If you want them to work for particular site only, put the in .htaccess for this site.

User avatar
Posts: 16
Joined: 13 Nov 2012, 00:19

Re: No access to localhost after non www to www

18 Nov 2012, 22:47

This might work. I will try it then.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 18 guests