iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > HTML, XHTML and CSS

Reply
 
LinkBack Thread Tools
Old September 30th, 2008, 08:58 AM   #1
Reputable Member
 

Join Date: May 2005
Location: Sheffield
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Andy K is on a distinguished road
Redirect 301 but has spaces in the filename

I have revamped a website and I am redirecting old htm pages to new php pages using Redirect 301 in a .htaccess file.

Example:
Redirect 301 /results.htm http://www.domainname.co.uk/resultsfixtures-sept.php

This works fine but THE PROBLEM is some of the old pages have SPACES in them like this....

club products info.htm

I have tried: club%20products%20info.htm

But had no effect, returned 'not found' so my next effort was a Rewrite using back slashes like this....

RewriteRule ^club\ products\ info.htm/$ http://www.domainname.co.uk/products.php/ [R=301,L]

But this still returns NOT FOUND
The requested URL /club products info.htm was not found on this server.

So am I missing something on the Rewrite?

cheers
Andy
Andy K is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old September 30th, 2008, 11:16 AM   #2
Rob
Elite Veteran
SuperMember
 
Rob's Avatar
 

Join Date: Jul 2003
Location: Southern UK
Age: 35
Posts: 3,133
Blog Entries: 7
Thanks: 28
Thanked 22 Times in 19 Posts
Rep Altering Power: 0 Rob is a jewel in the rough Rob is a jewel in the rough Rob is a jewel in the rough
Re: Redirect 301 but has spaces in the filename

how about....
RewriteRule ^club%20products%20info.htm/$ http://www.domainname.co.uk/products.php/ [R=301,L]
__________________
Rob - Webforumz Founder

Latest Project: Sanctuary for Student Midwives
Rob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old September 30th, 2008, 11:24 AM   #3
Rob
Elite Veteran
SuperMember
 
Rob's Avatar
 

Join Date: Jul 2003
Location: Southern UK
Age: 35
Posts: 3,133
Blog Entries: 7
Thanks: 28
Thanked 22 Times in 19 Posts
Rep Altering Power: 0 Rob is a jewel in the rough Rob is a jewel in the rough Rob is a jewel in the rough
Re: Redirect 301 but has spaces in the filename

if the site has a small number of non product pages then I would set up seperate rules for those first in th htaccess file specifing the flag to stop processing more rules for those ones.

Once they are dealt with you are free to assume all other traffic must be to a product page and so you can redirect everything else to the product page.
__________________
Rob - Webforumz Founder

Latest Project: Sanctuary for Student Midwives
Rob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old September 30th, 2008, 12:14 PM   #4
Reputable Member
 

Join Date: May 2005
Location: Sheffield
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Andy K is on a distinguished road
Re: Redirect 301 but has spaces in the filename

RewriteRule ^club%20products%20info.htm/$ http://www.brinsworthwhitehilljfc.co.uk/products.php [R=301,L]

Brings the same Not Found error:
http://www.brinsworthwhitehilljfc.co...cts%20info.htm

I have dealt with around a dozen urls, there are just a few with spaces in where Im having a problem.

Last edited by Andy K; September 30th, 2008 at 12:23 PM..
Andy K is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old September 30th, 2008, 12:25 PM   #5
Reputable Member
 

Join Date: May 2005
Location: Sheffield
Posts: 108
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Andy K is on a distinguished road
Re: Redirect 301 but has spaces in the filename

How would I "redirect everything else" ?
Andy K is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Extra Spaces! CloudedVision WebForumz Suggestions 1 June 1st, 2008 10:01 PM
[SOLVED] Extracting filename without extension from variable string. frankenscarf JavaScript 3 January 11th, 2008 01:54 PM
uploader filename alexgeek JavaScript 0 October 8th, 2007 02:25 PM
Filename of the XML generated kdelacruz Other Languages 1 November 3rd, 2006 01:53 AM
Eliminate spaces timmytots HTML, XHTML and CSS 9 November 28th, 2005 01:50 AM


Search Engine Optimization by vBSEO 3.2.0 RC8