Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

301 redirect problem Rate Topic: -----

#1 User is offline   haku

  • 日本語 Ninja
  • Icon
  • Group: Staff
  • Posts: 652
  • Joined: 21-September 07
  • Location:Yokohama, Japan

Posted 10 June 2008 - 10:26 AM

I am trying to create a 301 redirect from site.com/access/index.htm to site.com/info/map.html

I am using this code in my .htaccess file (in the root directory):

Redirect 301 /access/index.htm http://www.site.com/info/map.html



The redirect works - kind of. The problem is that it is redirecting me to site.com/info/map.html/ (note the trailing forward slash). The page itself has google maps on it, and they don't work when the trailing slash is added to the URL.

Does anybody have any ideas on how to solve this problem?
0

#2 User is offline   benbacardi

  • The Graphix Dude
  • Icon
  • Group: Administrators
  • Posts: 1,124
  • Joined: 06-April 06
  • Gender:Male
  • Location:United Kingdom

Posted 10 June 2008 - 10:36 AM

I would do this with mod_rewrite instead I think:

RewriteEngine on
RewriteRule ^/access/index.htm$ http://www.site.com/info/map.html [R=301]

0

#3 User is offline   haku

  • 日本語 Ninja
  • Icon
  • Group: Staff
  • Posts: 652
  • Joined: 21-September 07
  • Location:Yokohama, Japan

Posted 10 June 2008 - 10:41 AM

Well, I got it to work by adding another .htaccess to the /info directory

RedirectMatch 301 (.*)\.html/$ http://www.site.com$1.html


I want to keep the permanent redirect, because when I'm done this site (tomorrow I hope!) I'm going to submit a sitemap to google. I know for a fact the pages are indexed on google, so hopefully this will help me keep the meagre seo rating they have.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users