Mobile app version of vmapp.org
Login or Join
Deb1703797

: Decode url in httpd.conf or htaccess For some reason I am getting 404 errors in my log file because of users trying to access something like http ://www.domain.tld%3Fid%3D222 instead of http://www.domain.tld?id=222

@Deb1703797

Posted in: #Apache #Domains #UrlRewriting

For some reason I am getting 404 errors in my log file because of users trying to access something like http ://www.domain.tld%3Fid%3D222 instead of www.domain.tld?id=222
I've unsuccessfully tried all sort of rewrite rules. Is there a way to decode URIs from Apache?

Related questions: stackoverflow.com/questions/7246497/htaccess-query-string-urldecode and stackoverflow.com/questions/8464298/rewrite-and-url-decoding

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Deb1703797

1 Comments

Sorted by latest first Latest Oldest Best

 

@Radia820

The htaccess syntax is this:

Redirect 301 "/%3Fid%3D222" www.domain.tld?id=222

Note the quotes around the ASCII characters in the first URL.

If it's a problem for multiple addresses then you might want to ask one of the regex gurus at StackOverflow to help you out.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme