Forum Moderators: phranque

Message Too Old, No Replies

%20 is Becoming %2520 in 301Redirection

Please Help

         

yuva

12:53 am on Dec 7, 2009 (gmt 0)

10+ Year Member



I am using .htaccess file to redirect http to https

The problem is if there is a space char in URL...it's making it as %2520..please help regarding this..


Options +FollowSymlinks
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html\ HTTP/
RewriteRule ^(([^/]+/)*)index\.html$ http%{ENV:askapache}://%{HTTP_HOST}/$1 [R=301,L]

g1smd

8:05 am on Dec 7, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Never use spaces or underscores in URLs.

Change the spaces to hyphens or some other punctuation in your links.

Note that one of your redirects is a 302 redirect.

jdMorgan

3:35 pm on Dec 7, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also, see the RewriteRule [NE] (NoEscape) flag.

The second rule was copied from another site. Part of it is missing, so it will not work. The author of the article containing that code has updated it based on a better method that I proposed, so you may want to go re-read that article.

Jim