Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 7th January 2007, 23:49
hairydog2 hairydog2 is offline
Senior Member
 
Join Date: Oct 2005
Posts: 196
Thanks: 9
Thanked 3 Times in 2 Posts
Unhappy Apache 301 redirect - file names with spaces

I've taken over a website that has been maintained by someone who didn't know what he was doing.

Most of the old pages had file names such as "Ticket Order Form (Day Tickets).htm"

I want to point people who come looking for the old pages to the new, properly named pages.

I've been trying to do it using an apache rewrite command in the .htaccess file in the web directory. The problem is that it won't work with any files that have spaces in the old names (that's nearly all of them)

Redirect 301 /Ticket%20Order%20Form%20%20(Day%20Tickets).htm http://www.domainname.co.uk/booking_form.html
gets me a 404 file not found error
Redirect 301 /Ticket Order Form (Day Tickets).htm http://www.domainname.co.uk/booking_form.html
gets me (as expected) a 500 server error.

It works fine for Redirect 301 /default.htm http://www.domainname.co.uk/index.html

Debian 3.1 perfect build, ISPConfig 2.2.9

Any suggestions?
Reply With Quote
Sponsored Links
  #2  
Old 7th January 2007, 23:58
jnsc jnsc is offline
rotaredoM
 
Join Date: Mar 2006
Location: Lausanne, Switzerland
Posts: 525
Thanks: 10
Thanked 172 Times in 77 Posts
Default

I don't know if this works, but did you try to put the name of the page in qoutes like this
Code:
Redirect 301 "/Ticket Order Form (Day Tickets).htm" http://www.domainname.co.uk/booking_form.html
Another thing you could do is having a look at your log files, in order to see how your apache deals with tis files.

Or you could use RedirectMatch instead of Redirect http://httpd.apache.org/docs/1.3/mod...#redirectmatch
Reply With Quote
  #3  
Old 8th January 2007, 00:29
hairydog2 hairydog2 is offline
Senior Member
 
Join Date: Oct 2005
Posts: 196
Thanks: 9
Thanked 3 Times in 2 Posts
 
Default

That sorted it! Both of your suggestions worked. Thanks.

Now I all I have to work out is why I spend so long struggling with it before asking here.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Systemimager (rsync) doesn't copy all comedit HOWTO-Related Questions 11 19th January 2007 17:17
HotSaNIC domino Tips/Tricks/Mods 23 6th November 2006 05:19
jamed up my table borders?? Boon-Dog-Danny Installation/Configuration 5 23rd September 2006 16:12
Howto suggestion suse PhP ver 4 + Ver 5 wwparrish Suggest HOWTO 11 7th August 2006 13:29
Problems with Apache and Updating Jubalint Installation/Configuration 2 21st May 2006 19:50


All times are GMT +2. The time now is 08:39.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.