Hello,
I have mod_rewrite enabled on my forum. The code looks like this in .htaccess:
Code:
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} .*\.(jpeg|jpg|gif|png)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /public/404.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Now, I want to redirect WWW to non-www with this code:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.myforum.eu [nocase]
RewriteRule ^(.*) http://myforum.eu/$1 [last,redirect=301]
When I add the code to the end of the file, it starts to redirect
www.myforum.eu/page1.html to the index.php file because of the "RewriteRule . /index.php. How could I get both www to non-www and mod_rewrite SEO friendly URL's working?