htaccess 301 permanent redirect?

Discussion in 'HTML & Website Design' started by mokimofiki, Feb 3, 2010.

  1. #1
    I am having an issue with my redirect working properly.

    My htaccess to my knowledge is setup correctly although if I go to the page that should be redirected it doesn't.

    my htaccess file is:
    DirectoryIndex index.php
    
    redirect 301 /index.html http://www.embassysuitesconcord.com/index.php
    redirect 301 /pages/accomodations_amenities.html http://www.embassysuitesconcord.com/accommodations.php
    redirect 301 /pages/accomodations_resort_suites.html http://www.embassysuitesconcord.com/accommodations.php
    redirect 301 /pages/accomodations_resort_packages.html http://www.embassysuitesconcord.com/accommodations.php
    redirect 301 /pages/accomodations_virtual_tour.html http://www.embassysuitesconcord.com/accommodations.php
    redirect 301 /pages/rocky_river_golf_club_golf_course.html http://www.embassysuitesconcord.com/golf.php
    redirect 301 /pages/rocky_river_golf_club_tournaments_events.html http://www.embassysuitesconcord.com/golf.php
    redirect 301 /pages/rocky_river_golf_club_clubhouse.html http://www.embassysuitesconcord.com/golf.php
    Code (markup):
    Thank you in advance.
     
    mokimofiki, Feb 3, 2010 IP
  2. krsix

    krsix Peon

    Messages:
    435
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    RedirectMatch 301 /index.html http://www.embassysuitesconcord.com/index.php
    RedirectMatch 301 /pages/accomodations_amenities.html http://www.embassysuitesconcord.com/accommodations.php
    RedirectMatch 301 /pages/accomodations_resort_suites.html http://www.embassysuitesconcord.com/accommodations.php
    RedirectMatch 301 /pages/accomodations_resort_packages.html http://www.embassysuitesconcord.com/accommodations.php
    RedirectMatch 301 /pages/accomodations_virtual_tour.html http://www.embassysuitesconcord.com/accommodations.php
    RedirectMatch 301 /pages/rocky_river_golf_club_golf_course.html http://www.embassysuitesconcord.com/golf.php
    RedirectMatch 301 /pages/rocky_river_golf_club_tournaments_events.html http://www.embassysuitesconcord.com/golf.php
    RedirectMatch 301 /pages/rocky_river_golf_club_clubhouse.html http://www.embassysuitesconcord.com/golf.php
     
    krsix, Feb 3, 2010 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    "Redirect" is the correct directive. "RedirectMatch" is for cases where you're using regexps to define the old url.

    Be sure your old path is correct. Is "/pages/whatever.html" right? It's not at the docroot level?

    Do you have mod_alias enabled?

    I know these are elementary questions, but they're often overlooked.

    cheers,

    gary
     
    kk5st, Feb 3, 2010 IP
  4. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #4
    Ack! Your server is IIS*. To my knowledge, IIS does not support .htaccess directives. See IIS 301 redirects @ Webmaster World for instructions.

    In reference to my previous post, never mind. :(

    cheers,

    gary

    * Unless you're stuck using ASP.Net or some such, I can't imagine why anyone would use a MSFT IIS host server.
     
    kk5st, Feb 3, 2010 IP
    mokimofiki likes this.
  5. mokimofiki

    mokimofiki Well-Known Member

    Messages:
    444
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #5
    Ah that could be the case ... its not my server (none of my servers are IIS because I never need it) so I didn't even think to look I just assumed. I will speak with the Host owner and see if its IIS.

    Again thank you.
     
    mokimofiki, Feb 4, 2010 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    You need only look at the response header.
    Response Headers - http://www.embassysuitesconcord.com/index.php
    
    Connection: close
    Date: Thu, 04 Feb 2010 23:24:34 GMT
    [color=red]Server: Microsoft-IIS/6.0[/color]
    X-Powered-By: ASP.NET, PHP/5.2.11
    Content-Type: text/html
    
    200 OK
    Code (markup):
    cheers,

    gary
     
    kk5st, Feb 4, 2010 IP
  7. mokimofiki

    mokimofiki Well-Known Member

    Messages:
    444
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    130
    #7
    Thank you all, I made an assumption and didn't think to double check. I have fixed this.

    Thank you again.
     
    mokimofiki, Feb 19, 2010 IP