Log in

View Full Version : www.mysite.com and mysite.com


Jon12345
10-14-2013, 03:48 PM
When you go to my homepage, if you type mysite.com, it goes to www.mysite.com. But if you go to mysite.com/forums/, it stays there.

Am I losing rankings as a result of this? How can I get it to go to www.mysite.com/forums/ ?

You can see it here: http://access-programmers.co.uk/forums/

Thanks,

Jon

ikopylov
10-14-2013, 06:06 PM
put .htaccess file to root of you site

with:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

All requests and ranking from http://www.you_site.com will be forwarded to the http://you_site.com

futureaudio
10-14-2013, 06:07 PM
You need to create a .htaccess file to redirect all your visitors to one version.

Add this code to the file if you want to redirect them to www version of your site:

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

ForceHSS
10-14-2013, 07:38 PM
Upload this to your root with your FTP program. Make sure you unzip it first

Jon12345
10-15-2013, 11:13 AM
I already had this code in my htaccess file:

RewriteEngine On

# Externally redirect only direct client requests for /index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index.(html?|php)\ HTTP/
RewriteRule ^(([^/]+/)*)index.(html?|php)$ http://www.access-programmers.co.uk/$1 [R=301,L]
#
# Externally redirect to canonicalize the domain name if a non-canonical
# hostname is requested, in order to prevent duplicate-content problems
RewriteCond %{HTTP_HOST} !^(www\.access-programmers\.co.uk)?$
RewriteRule (.*) http://www.access-programmers.co.uk/$1 [R=301,L]

It seems to work for the root, but what is wrong with it because its not working for the forums. directory?

ForceHSS
10-15-2013, 04:10 PM
I already had this code in my htaccess file:

RewriteEngine On

# Externally redirect only direct client requests for /index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index.(html?|php)\ HTTP/
RewriteRule ^(([^/]+/)*)index.(html?|php)$ http://www.access-programmers.co.uk/$1 [R=301,L]
#
# Externally redirect to canonicalize the domain name if a non-canonical
# hostname is requested, in order to prevent duplicate-content problems
RewriteCond %{HTTP_HOST} !^(www\.access-programmers\.co.uk)?$
RewriteRule (.*) http://www.access-programmers.co.uk/$1 [R=301,L]

It seems to work for the route, but what is wrong with it because its not working for the forums. directory?

You have the same info in there twice use the one i uploaded

Jon12345
10-15-2013, 05:11 PM
So what I had in there was slightly different versions of the same thing? i.e. one of them was redundant?

I have a very long htaccess file due to Wordpress security plugins and cache. These have lots of RewriteRule entries and so I am concerned about adding many further entries in case it impacts on them. So, I would be concerned if I put all the entries in that @ForceHSS kindly included in the htaccess file. It also appears as though that file has other changes, such as perhaps changing members.php to perhaps members/. This could impact on my Wordpress install.

Is there something in my existing code that is stopping it working for the forums directory?

ForceHSS
10-15-2013, 05:42 PM
If you are worried just add the top part of that file i uploaded the part that has the url but do keep a copy of the one you have now