| | #1 |
| Warrior Member Join Date: 2011
Posts: 18
Thanks: 0
Thanked 2 Times in 2 Posts
|
Hi, so i want redirect non www to www But something is going wrong. When i write my url without www it´s redirect to: mydomain/index.php//mydomain .htaccees file looking like this: AddType application/x-httpd-php53 php53 php <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ public/ [L] RewriteRule (.*) public/$1 [L] </IfModule> Options +FollowSymlinks RewriteEngine on rewritecond %{---_host} ^mydomain [nc] rewriterule ^(.*)$ ------.mydomain /$1 [r=301,nc] What i did wrong? |
| |
| | #2 |
| HyperActive Warrior War Room Member Join Date: 2012
Posts: 168
Thanks: 0
Thanked 55 Times in 36 Posts
|
AddType application/x-httpd-php53 php53 php <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ public/ [L] RewriteRule (.*) public/$1 [L] </IfModule> Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,NC] |
| | |
| |
| | #3 |
| Warrior Member Join Date: 2011
Posts: 18
Thanks: 0
Thanked 2 Times in 2 Posts
|
Thanks! it's works |
| |
| | #4 |
| Warrior Member Join Date: 2012
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
I also use this its work thanx for such a nice share.
|
| |
| | #5 | |
| Boost your Site in Days Join Date: 2010 Location: www.BestLinkWheel.com
Posts: 18
Thanks: 0
Thanked 1 Time in 1 Post
|
here is good code to 301 redirect, write in .htaccess:
| |
| | ||
| |
|
| Bookmarks |
| Tags |
| 301, problem, redirect |
| |