Welcome to WebmasterWorld Guest from 50.16.112.199

Forum Moderators: phranque

Setting .htaccess to redirect user from an odd URL for SEO sake

.htaccess redirecting

   
8:31 am on Jun 14, 2007 (gmt 0)

5+ Year Member



Hi,

I'm wondering if there's a code one can use to redirect users from a very odd URL that comes up in my CMS when one clicks on "Home".

When someone types:

[mysite.com...]

They get there alright. But when they click on "Home", they are sent to an URL like that:

[mysite.com...]

This is certainly not good for SEO sake as the page rank will get "diluted" in two URLs.

So how does one write a rule in a .htaccess file to redirect users from that page to the root URL - which is after all the same page anyway?

keywords: .htaccess, redirect, redirecting, URL, SEO

9:17 pm on Jun 14, 2007 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



As well as setting up a redirect for both search engines and users alike to follow, those that already have the "wrong" URL that is, you also need to hard code the link on your site to point to the "correct" URL. This is vital.

For the .htaccess code, see the Apache forum here. The "index file redirect" question is asked and answered on a fairly regular basis.

9:54 am on Jun 15, 2007 (gmt 0)

5+ Year Member



Thanks g1smd,

I didn't realize I could find answers in the Apache forum, certainly my brain is getting hard coded into a jelly fish.

Thanks for the advice, will keep trying, even though I don't seem to get it to redirect for some reason. The .htaccess provided by this CMS is huge, so it could be something overriding the new RewriteRule I've set. No idea...

Cheers!

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month