hello, when people visiting my site they gey only urls like http://www.mydomain.com etc etc but i i want no www, they must see urls like http://mydomain.com my .hacces file: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Code (markup): hope someone will help
This has been explained over and over throughout this forum so you wouldn't have to wait for my answer if you would try searching first. Anyway this is the rule to be added into your .htaccess files Options +FollowSymlinks RewriteEngine on RewriteCond %{http_host} ^www\.yourdomain\.com [NC] RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,NC] Code (markup):
but how to put that in my code of .hacces here above? how will the code looks like i did as next but its not working: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] RewriteCond %{http_host} ^www\.mysiteurl\.com [NC] RewriteRule ^(.*)$ http://mysiteurl.com/$1 [R=301,NC] </IfModule> # END WordPress
check your hosting-account control-panel also - there is provision for 'www' with domain or not - also provided!
If you cannot find your control panel, are then you reading this file through your FTP? Either you are working with FTP or Filemanager, make sure to overwrite the above setting this way: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] RewriteCond %{http_host} ^www\.mysiteurl\.com [NC] RewriteRule ^(.*)$ http://mysiteurl.com/$1 [R=301,NC] </IfModule> # END WordPress Options +FollowSymlinks RewriteEngine on RewriteCond %{http_host} ^www\.yourdomain\.com [NC] RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,NC] Code (markup): Once done, save the file and it must do the trick