Hi! Please, help me setup redirection from <http://>; to <http://www.>; On mydomain I install wordpress and htaccess file looked like: ==================================================== # 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): ================================================ In the file begin, I insert this code: ================================================ # Always use www in the domain # Replace 'mydomain.com' with your domain name RewriteEngine on RewriteCond %{HTTP_HOST} ^([a-z.] )?mydomain\.com$ [NC] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .? <http://www.%1mydomain.com%{REQUEST_URI}>; [R=301,L] Code (markup): ================================================ And as result, htaccess file look like: ================================================ # Always use www in the domain # Replace 'mydomain.com' with your domain name RewriteEngine on RewriteCond %{HTTP_HOST} ^([a-z.] )?mydomain\.com$ [NC] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .? <http://www.%1mydomain.com%{REQUEST_URI}>; [R=301,L] # 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): ================================================ But it doesn't help. Browser write - "WRONG REDIRECTION" Please help me Undecided Thanks! -- Dmitry
RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.tolranet\.co\.uk [NC] RewriteRule (.*) http://www.tolranet.co.uk/$1 [R=301,L] # 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): The above redirects anything not www.tolranet.co.uk to www.tolranet.co.uk, you need to change the domain name, if you'd given your domain I'd have done it for you.
RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.tolranet\.co\.uk [NC] RewriteRule (.*) http://www.tolranet.co.uk/$1 [R=301,L] # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress