Mobile app version of vmapp.org
Login or Join
Cooney921

: 301 redirect for a page with a space in it 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&

@Cooney921

Posted in: #301Redirect #Htaccess #Redirects

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 www.example.com/gallery/

where the new page is:

example.com/gallery


Is this correct?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Cooney921

1 Comments

Sorted by latest first Latest Oldest Best

 

@Alves908

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" www.example.com/gallery/

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme