SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2003
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Permanant redirect for a specific directory?

    Hello,
    in my /www/ I currently have an .htaccess that contains:

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST}!^www\.mysite\.com
    rewriterule (.*) http://www.mysite.com/$1 [R=permanent,L]
    So mysite.com will redirect to www.mysite.com.

    I would like to add an additional feature in my .htaccess (or in another .htaccess) so: www.mysite.com/directory/ (and www.mysite.com/directory/index.php) will have a permanent redirect to www.mysite.com .

    How should I do this?
    Shoud I add something to the current .htaccess? Or should I place a new .htaccess in the /www/directory/?
    And what should I put in it?

    Thanks in advance,
    Koros

  2. #2
    Can we go to a 48 hour day?
    Join Date
    May 2002
    Location
    MI
    Posts
    906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If it's a php site the easiest thing I could think of is just add a redirect into the index.php file of the directory.
    mitechie.com
    "Techies just think a little differently
    ...at least that is what they keep telling me."

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2003
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How would you do this ? (altough I prefer the permanent redirect) ?

    Koros

  4. #4
    Can we go to a 48 hour day?
    Join Date
    May 2002
    Location
    MI
    Posts
    906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
     
     header
    'refresh: 0; url=/foldername/index.php' ); 
    mitechie.com
    "Techies just think a little differently
    ...at least that is what they keep telling me."


Bookmarks

Posting Permissions

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