homepage Welcome to WebmasterWorld Guest from 54.167.185.110
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

This 31 message thread spans 2 pages: < < 31 ( 1 [2]     
redirecting subdomain to subfolder
surrealillusions




msg:4500120
 10:42 am on Sep 26, 2012 (gmt 0)

I am updating a site of mine and would like to redirect a fair few subdomain URL's to subfolders.

Here's an example of whats currently setup.

galleries.example.com/name-of-gallery/randomnumbers
galleries.example.com/another-gallery-name/randomnumbers

I would like to forward them to

example.com/gallery/name-of-gallery
example.com/gallery/another-gallery-name

The folders are going to be setup with the correct names. The problem is, how to do this via .htaccess redirects without writing each one out individually.

The random numbers at the end of the subdomain URL's are probably going to cause a pain but there's nothing I can do about them.

I could write them all out, but that would make for a very large .htaccess file - unless that's the only way to do this?

 

coachm




msg:4503476
 2:07 pm on Oct 3, 2012 (gmt 0)

Hi, I also need to do this in a Plesk control panel environment, and the above convo is a bit confusing for me to follow. Here's my situation.

example.com is the main domain
sub.example.com is the subdomain I want to redirect to example.com/newdirectory

The structure is that the subdomain is in a directory under the main domain in the root directory (i.e. the directory that contains httpdocs.cgi-bin, etc.

The address bar should reflect the NEW (redirected TO) info.

Should be simple?

This 31 message thread spans 2 pages: < < 31 ( 1 [2]
Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved