Old 10-06-2008, 10:49   #1 (permalink)
haku
shiro
 
haku's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,007
301 Redirect problem

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):

Code:
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?
__________________
This space for rent.
  Reply With Quote
Old 10-06-2008, 11:46   #2 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 764
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
What about the following...

Code:
RewriteEngine On RewriteRule /access/index.htm$ /info/map.html [R=301]
__________________
  Reply With Quote
Old 10-06-2008, 21:22   #3 (permalink)
haku
shiro
 
haku's Avatar
 
Join Date: Aug 2007
Location: Yokohama, Japan
Posts: 2,007
Thanks Mike, that worked. Kind of! Now it is forwarding:

Code:
site.com/access/index.htm

but it won't forward

Code:
www.site.com/access/index.htm

Here is my entire root directory .htaccess:

Code:
AddHandler application/x-httpd-php .html Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^site.com [nc] rewriterule ^(.*)$ http://www.site.com/$1 [r=301,nc] RewriteRule /access/index.htm$ http://www.site.com/info/map.html [R=301]

Anybody have any ideas on how I can get it to forward the page with or without the www extension? Thanks.
__________________
This space for rent.
  Reply With Quote
Old 11-06-2008, 05:25   #4 (permalink)
MikeMackay
Everything is fine.
 
MikeMackay's Avatar
 
Join Date: Feb 2005
Location: Witham & London
Posts: 764
Send a message via MSN to MikeMackay Send a message via Skype™ to MikeMackay
Hmm
Quote:
RewriteRule (.*)site.com/access/index.htm$ www.site.com/info/map.html [R=301]

Not sure if that will work or not ? It's all I can think of for now.
__________________
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8