Welcome to WebmasterWorld Guest from 62.210.77.51

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Mod rewrite from subdomain to directory on main

Conv. http://wiki.example.com/sample to http://www.example.com/wiki/sample

     
1:42 pm on Sep 12, 2007 (gmt 0)

Junior Member

5+ Year Member

joined:Jan 11, 2007
posts: 44
votes: 0


Hello,

First I apologise for another mod_rewrite question. I have searched the forum and found some conditions that seem similar to mine, but I don't get it!

Here is my setup:

I currently have a wiki at a sub-domain with directory-esque pages, example:

[wiki.example.com...]
[wiki.example.com...]
[wiki.example.com...]
etc

I want to exactly map any requests from the sub-domain to a directory in the main domain, for example http://www.example.com/wiki.

So the original address of
[wiki.example.com...]
would permanently redirect to
http://www.example.com/wiki/samplepage

and the original address of
[wiki.example.com...]
would permanently redirect to
http://www.example.com/wiki/

and the original address of
[wiki.example.com...]
would permanently redirect to
http://www.example.com/wiki/sample1/sample2/sample3

etc

I think it should be simple but the answer as yet eludes me!

Any help greatly appreciated :)

1:59 pm on Sept 12, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


See Apache mod_alias [httpd.apache.org], and specifically the RedirectPermanent or Redirect 301 directives.

Note that the part of the local URL-path that you do not specify on the left side will be retained and 'copied' to the end of new URL on the right.

Jim

7:37 am on Sept 13, 2007 (gmt 0)

Junior Member

5+ Year Member

joined:Jan 11, 2007
posts:44
votes: 0


Thanks jdMorgan, I knew it would/should be something simple. Many thanks :)