No access to localhost after non www to www
3 posts
• Page 1 of 1
- Feeling USA
- Posts: 1
- Joined: 25 Jun 2012, 11:04
No access to localhost after non www to www
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?
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?
Re: No access to localhost after non www to www
"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.
- 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.
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 18 guests