hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Redirect from one folder to another via .htaccess ?
Reply

Forum Jump

Redirect from one folder to another via .htaccess ?

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old
Aspiring Evangelist
 
Join Date: May 2005
Posts: 367
Question

Redirect from one folder to another via .htaccess ?


Hi All,

Quick question about redirection.

We had a subdomain that was http://gallery.mydomain.com and we have now decided we would like to use http://www.mydomain.com/gallery

I have setup the gallery on the new server as http://www.mydomain.com/gallery

I would like to be able to if someone had a link http://gallery.mydomain.com/events/harden06/ for it to redirect them too http://www.mydomain.com/gallery/events/harden06/

Any advice would be appreciated.

Regards,

Joel



Sponsored Links
  #2  
Old
Community Leader
 
Join Date: Oct 2002
Location: Neck deep in it
Posts: 20,118
Place a file called ".htaccess" in the site's root, and in it, this:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^gallery\.mydomain\.com$ [NC]
RewriteRule /?(.*) http://www.mydomain.com/gallery/$1 [L,R]
Haven't tested, though.

  #3  
Old
Aspiring Evangelist
 
Join Date: May 2005
Posts: 367
It worked perfectly. I put it in the subdomain's root directory and everything is working.

Thankyou very very much.

Regards,

Joel

Sponsored Links
  #4  
Old
Community Leader
 
Join Date: Oct 2002
Location: Neck deep in it
Posts: 20,118
Glad to help out.

Reply

Related posts from TheWhir.com
Title Type Date Posted
Think Encrypted Cloud Storage is Secure? Think Again, Researchers Say Web Hosting News 2014-04-30 18:21:56
Single Tweet Brings Dropbox DMCA Takedown Policy into Spotlight Web Hosting News 2014-03-31 04:30:00
DataCloud Canada Listing 2014-01-24 20:50:20
Mistakes To Avoid When Launching A New Website Design Blog 2014-01-10 10:53:50
Dimension Data to Launch Three-Tier Cloud Backup Add-On Service Web Hosting News 2013-08-06 15:55:24


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Advertisement:
Web Hosting News:
WHT Membership
WHT Membership



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?