Jump to content

301 redirect problem

Whether you're a seasoned veteran or a struggling beginner, Web Radiance is the web development and web design forum for you. You'll find answers to all your HTML, CSS, SEO, and Programming needs. Pull up a chair and stay awhile.

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

301 redirect problem Rate Topic: -----

#1 User is offline   haku 

  • 日本語 Ninja
  • Group: Members
  • Posts: 652
  • Joined: 21-September 07
  • Gender:Male
  • 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?
<a href="http://www.jaypan.com" target="_blank">Jaypan</a>
<a href="http://www.dudes-japan.com" target="_blank">Dudes Japan</a>
0

#2 User is offline   benbacardi 

  • Administrator
  • Group: Administrators
  • Posts: 1,140
  • 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
  • Group: Members
  • Posts: 652
  • Joined: 21-September 07
  • Gender:Male
  • 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.
<a href="http://www.jaypan.com" target="_blank">Jaypan</a>
<a href="http://www.dudes-japan.com" target="_blank">Dudes Japan</a>
0

#4 User is offline   che09 

  • W.R. Corporal
  • Group: Members
  • Posts: 50
  • Joined: 22-November 10

Posted 22 November 2010 - 08:51 PM

May I know why you need to create a Redirect page?
0

#5 User is offline   Rob Kaper 

  • W.R. Corporal
  • Group: Members
  • Posts: 97
  • Joined: 19-July 08
  • Gender:Male
  • Location:Rotterdam, NLD

Posted 25 November 2010 - 03:10 PM

Sometimes you have to reorganise your URL structure and you want to avoid inconvenience for those who still have the old URLs available. It is good practice to update any publically available reference to point to the new URL, but there will be references out of your control. You'll want to redirect those URLs for a while, until the references are updated or become obsolete.
Rob Kaper - Rotterdam
0

#6 User is offline   Karl Buckland 

  • A.K.A. Sirkent
  • Group: Administrators
  • Posts: 2,145
  • Joined: 04-April 06
  • Gender:Male
  • Location:Kent, UK

Posted 26 November 2010 - 06:18 PM

This is a very old topic! I expect the issue has been resolved by now.
QUOTE(benbramz @ Aug 17 2007, 07:44 AM) Ive noticed that quite a few people are now adding quotes from the board into their signature. I think its started an new web-radiance craze.. :P
0

#7 User is offline   che09 

  • W.R. Corporal
  • Group: Members
  • Posts: 50
  • Joined: 22-November 10

Posted 28 November 2010 - 07:32 PM

View PostRob Kaper, on 25 November 2010 - 03:10 PM, said:

Sometimes you have to reorganise your URL structure and you want to avoid inconvenience for those who still have the old URLs available. It is good practice to update any publically available reference to point to the new URL, but there will be references out of your control. You'll want to redirect those URLs for a while, until the references are updated or become obsolete.


Now,I get the point! Thank you,this has been resolved! ;)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

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