Results 1 to 4 of 4
  1. #1
    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

  2. #2
    Join Date
    Oct 2002
    Location
    /roof/ledge
    Posts
    28,088
    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. #3
    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

  4. #4
    Join Date
    Oct 2002
    Location
    /roof/ledge
    Posts
    28,088
    Glad to help out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •