Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some pages from a client's old template-based site which have spaces in them. For example, one of the pages looks like this:

example.com/page.php?domain_name=example.com&viewpage=Gallery %26 News

I'm thinking that the correct way to do an htaccess 301 redirect is to include something like this:

Redirect 301 /page.php?domain_name=example.com&viewpage=Gallery%20%26%20News http://www.example.com/gallery/

where the new page is:


Is this correct?

share|improve this question
up vote 2 down vote accepted

The URL path for the mod_alias Redirect should be %-decoded. If it contains spaces then surround the path in double quotes:

Redirect 301 "/page.php?domain_name=example.com&viewpage=Gallery & News" http://www.example.com/gallery/
share|improve this answer
Thank you, I'll do that. – user417627 Nov 22 '12 at 16:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.