I am trying to redirect my whole site to non-www
here is the htaccess code I am using
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# no www
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.akorra\.com$ [NC]
RewriteRule ^.*$ http://akorra.com%{REQUEST_URI} [R=301,L]
any ideas
Here is what you need to add to your .htaccessHowever, if you are working with Wordpress as the engine that powers your entire site, just update the permalink structure and all internal settings with your domain name in it to remove the www.
EDIT:
I thought that was different when I wrote the answer Sorry. Try moving your non www rule to the top...
AGAIN keep in mind if Wordpress is set to produce links with a
www
then nothing will stop it from reverting everything back to having a www even with a correct rewrite rule.More Wordpress details:
Check the settings in
wp/wp-admin/options-general.php
...www
inWordPress address (URL)
www
inBlog address (URL)
AND then update your premalink structure in
wp-admin/options-permalink.php
so the changes are reflected.After all that is said and done, be sure Wordpress did not overwrite new code in your
.htaccess
file.Hi I think you need to adjust your script as follows for the rewriting to work:
I believe that the follow symlinks absolutely has to be included for url rewriting to work properly.
More advice on mod_rewrite here:
http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html
Rob
I think your rules need to between the module tags.
This should work
I suggest to use this piece of code for removing www from your website:
it's more generic.
and in your example it's best to use this: