Quantcast
Channel: BitNami Answers - latest questions
Viewing all articles
Browse latest Browse all 2052

Redirect www to non-www works for all links except the root.

$
0
0

I have the following code in my htaccess file that is used to redirect all www URLs to non-www URLs. This works for all links except the root.

For example, http://www.noshon.it/recipes redirects properly to http://noshon.it/recipes. However, http://www.noshon.it incorrectly redirects to http://noshon.it/wordpress (where it receives a 404 page).

I can't figure out why all ULRs work except for the root. Any help would be much appreciated.

  
RewriteEngine On   
RewriteCond %{HTTP_HOST} ^www\\.noshon\\.it$ [NC]  
RewriteRule ^(.*)$ http://noshon.it/$1 [R=301,L]  
RewriteBase /  
RewriteRule ^index\\.php$ - [L]  
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d  
RewriteRule . /index.php [L]  

Viewing all articles
Browse latest Browse all 2052

Trending Articles