Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 15th Feb 2012, 12:56 PM   #1
Warrior Member
 
Join Date: 2011
Posts: 18
Thanks: 0
Thanked 2 Times in 2 Posts
Default
301 redirect problem
Share on: 
fb share twitter share gplus share more share

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?
ztume is offline  
Unread 15th Feb 2012, 01:06 PM   #2
HyperActive Warrior
War Room Member
 
Nochek's Avatar
 
Join Date: 2012
Posts: 168
Thanks: 0
Thanked 55 Times in 36 Posts
Default
Re: 301 redirect problem
Share on: 
fb share twitter share gplus share more share

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]

Nochek Solutions Presents:
The Hydrurga WSO - Rank Your Site #1 And Score Over The Penguin Updates!
Nochek is offline  
Unread 15th Feb 2012, 01:50 PM   #3
Warrior Member
 
Join Date: 2011
Posts: 18
Thanks: 0
Thanked 2 Times in 2 Posts
Default
Re: 301 redirect problem
Share on: 
fb share twitter share gplus share more share

Thanks!
it's works
ztume is offline  
Unread 17th Feb 2012, 11:33 PM   #4
Warrior Member
 
Join Date: 2012
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: 301 redirect problem
Share on: 
fb share twitter share gplus share more share

I also use this its work thanx for such a nice share.
Fiverivers is offline  
Unread 20th Feb 2012, 07:59 AM   #5
Boost your Site in Days
 
bbleo's Avatar
 
Join Date: 2010
Location: www.BestLinkWheel.com
Posts: 18
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: 301 redirect problem
Share on: 
fb share twitter share gplus share more share

here is good code to 301 redirect, write in .htaccess:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule (.*) example2.com/$1 [R=301,L]

bbleo is offline  
Closed Thread


Bookmarks

Tags
301, problem, redirect


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 01:19 PM.