Forum Moderators: phranque

Message Too Old, No Replies

Change forum from "Home dir" to another "dir"

using 301 redirect always get an infinite loop...

         

tintin74

6:54 pm on Aug 25, 2005 (gmt 0)

10+ Year Member



Hello,

I've a strange problem.I've move my forum from www.example.com to www.example.com/forum/

In order to provide to the bots the paths of new files I'm using a 301 redirect, this:

Redirect permanent / http://www.example.com/forum/

Using this string I get an infinite loop :in the url bar I see www.example.com/forum/forum/forum/forum/forum/forum/forum/forum/forum/....

Using this string everything works well:

Redirect permanent /portal.php http://www.example.com/forum/portal.php

but I cannot redirect everypage of my forum to the new one manually.
So, does anyone have a good idea to make this .htaccess work?

Thanks to all

tintin74

8:32 pm on Aug 25, 2005 (gmt 0)

10+ Year Member



Using this string

RedirectMatch permanent ^/$ http://www.example.com/forum/

every page request goes to the right page.This work for me, but there's another problem:

any subdomain request like foo.example.com send the visitors to http://www.example.com/forum/ and I don't want that.

Any idea?

jdMorgan

9:37 pm on Aug 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want to avoid redirection when subdomains are requested, you'll need to use mod_rewrite, testing %{HTTP_HOST} to detect subdomain requests.

Redirect, RedirectMatch, and othe mod_alias directives are simple, but limited in their capability.

Jim

tintin74

9:44 am on Aug 26, 2005 (gmt 0)

10+ Year Member



Thank you jdMorgan,

could you make a simple example of that? I don't know how to make it.