redirect http://mysite.com to http://www.mysite.com

Status
Not open for further replies.

lankatr

New Member
Messages
24
Reaction score
0
Points
0
Hi I wanna redirect http://mysite.com to http://www.mysite.com I tried with redirect section in Cpanel but it allows only one entry I have already redirected all traffic to http://mysite.com/wp/
 

carl6969

Community Support Team
Community Support
Messages
6,874
Reaction score
206
Points
63
Perhaps I am misunderstanding your question and if that is the case please clarify it for me.
You cannot redirect your website twice. Why would you want to? Therefore you will need to remove the existing redirect before you can create a new redirect.
 

Humza

New Member
Messages
66
Reaction score
3
Points
0
Hi carl6969 and lankatr, i think what lankatr wants is a .htaccess force www, it is below:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301]

--

save the following to your .htaccess file via cPanel file manager. [remember to ckeck the box show hidden . files]
 

lankatr

New Member
Messages
24
Reaction score
0
Points
0
thanks humza I tried your way but still the site points to http://mysite.com/wp

my .htaccess

RewriteEngine On

RewriteCond %{HTTP_HOST} ^mysite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.mysite.com$
RewriteRule ^/?$ "http\:\/\/www\.mysite\.com\/wp\/" [R=301,L]
 

lankatr

New Member
Messages
24
Reaction score
0
Points
0
Thanks Carl,
Actually my site is running Wordpress so I have to redirect all traffic to my WP folder
 

calistoy

Free Support Volunteer
Community Support
Messages
5,602
Reaction score
87
Points
48
The only difference I see is that you want the www part to open your site as well. If that's correct, your domain name already works with www in front of it.
 

lankatr

New Member
Messages
24
Reaction score
0
Points
0
Thanks,
I moved all ma WP files under the root directory and redirected http:// to http://www. now it works fine
thanks again
 
Status
Not open for further replies.
Top