6

I am trying to create this redirect:

Redirect /commercial%20work.html http://nataliearriolaphotography.com/fine-art-photography-prints.html

The problem is that when I first created this page I left a space in the file name. In other words it was "/commercial work.html". In chrome and safari the url reads as above with the %20 in place of the space, but when I create this redirect it does not work. I have also tried the following:

Redirect /commercial work.html http://nataliearriolaphotography.com/fine-art-photography-prints.html

This does not work either. It causes a server error page to appear. Does anyone have any suggestions? Thanks!

Jon Lin
  • 142,182
  • 29
  • 220
  • 220
evangelion3258
  • 77
  • 1
  • 2
  • 7

2 Answers2

24

Try adding quotes. So

Redirect "/commercial work.html" http://nataliearriolaphotography.com/fine-art-photography-prints.html
Gerben
  • 16,747
  • 6
  • 37
  • 56
  • Gerben, thanks for the answer, but that doesn't work either. It causes a server error page to appear. Maybe it has something to do with fatcow? Acutally I missed the quotes. Let me try it again! Sorry! – evangelion3258 Jan 04 '13 at 20:14
  • @evangelion3258 what do you mean by fatcow? – Ayman Farhat Jan 04 '13 at 20:16
  • You're welcome. In return, please mark it as answered. Thanks. – Gerben Jan 04 '13 at 20:23
  • Hi, I am trying t get it work, but this case isn't working with quotes, gives 500 Error (tried multiple variations) `RedirectMatch 301 ^/2012 files/(.*)$ /archives/old-website/2012 files/$1` – Yatko Oct 22 '15 at 01:11
  • @Yatko is the `mod_alias` module loaded? Also try `RedirectMatch 301 ^/2012\ files/(.*)$ /archives/old-website/2012\ files/$1` – Gerben Oct 22 '15 at 09:06
  • @Gerben: I am also troubling with this. Your solution is not working for me. What can issue is? Is there any server issue? – Vishal Chanana Sep 05 '16 at 13:38
  • @VishalChanana You might want to clear your cache and then try again. I had the same issue... – Malachi Dec 13 '16 at 16:17
  • @Gerben What would the Rewrite equivalent be? I tried the Rewrite, but got errors all the time; it wanted to redirect to the root of the server instead of the domain.. not sure why it didn't work... – Malachi Dec 13 '16 at 16:21
2

Put the page name in quotes should do it, for example:

Redirect 301 "/commercial work.html" http://nataliearriolaphotography.com/fine-art-photography-prints.html
Ayman Farhat
  • 2,010
  • 3
  • 17
  • 16