Welcome to WebmasterWorld Guest from 54.167.46.29

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

redirecting subdomain to subfolder

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

Preferred Member

5+ Year Member

joined:Dec 10, 2007
posts: 507
votes: 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?
2:07 pm on Oct 3, 2012 (gmt 0)

Preferred Member

5+ Year Member

joined:Nov 15, 2007
posts:610
votes: 1


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
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members