Log in

View Full Version : SEO friendly redirect + questions


Iskib
08-24-2007, 03:14 AM
I am using forums in the / forums with no landing page.

Now I know a 301 redirect is the best SEO friendly redirect using .htaccess

Redirect 301 /old/old.html http://www.you.com/new.html

I also want to redirect all http://mydomain.com to http://www.mydomain.com

I can do this with the .htaccess file using this code

RewriteEngine On
rewritecond %{http_host} ^yoursite.com
rewriteRule ^(.*) http://www.yoursite.com/$1 [R=301,L]

The question I have is can I use both like

RewriteEngine On
rewritecond %{http_host} ^yoursite.com
rewriteRule ^(.*) http://www.yoursite.com/$1 [R=301,L]
Redirect 301 /old/old.html http://www.you.com/forums

Thanks in advance

Brandon Sheley
08-24-2007, 03:49 AM
does it work when you use both ?

Iskib
08-24-2007, 04:20 AM
Not sure that is what I am asking. :)

valdet
08-24-2007, 02:18 PM
Hi there,
I am facing a similar issue here.

I managed to redirect from http://domain.net to http://www.domain.net with this htaccess trick
RewriteEngine On
Rewritecond %{http_host} ^yoursite.net
RewriteRule ^(.*) http://www.yoursite.net/$1 [R=301,L]



My question is how can I redirect http://domain.net/forum to http://www.domain.net/forum ?

The code below does not seem to work.

RewriteEngine On
Rewritecond %{http_host} ^yoursite.net/forum
RewriteRule ^(.*) http://www.yoursite.net/forum$1 [R=301,L]


Any clues...

Thanks

Dean C
08-24-2007, 02:42 PM
Have you thought about the opposite approach and actually dropping the usage of www. It's somewhat redundant unless you are using an alternative to the www config.

Iskib
08-27-2007, 01:38 PM
No I never really thought about dropping the www.

With the www or without the www I still would like to beable to redirect eithier domain.com to www.domain.com and/or www. domain.com to domain.com

I would also like to redirect the same with the /forums

Any ideas would be great.
I mean i know if a user types in domain.com I can redirect to www. or the other way.
Now what is there go directly to the forums ? what would be the code to redriect that ?

Dismounted
08-28-2007, 07:01 AM
RewriteEngine On

RewriteCond %{HTTP_HOST} ^YOURSITEURL\.com$ [NC]
RewriteRule ^(.*)$ http://www.YOURSITEURL.com/$1 [R=301,L]
Redirects everything to include "www.".