mod rewrite - How to use .htaccess to redirect a url which has a # character -
i've been looking @ couple of days, had guys @ work try , figure out didn't far.
i have url my.website.com/index.php#!lightbox[gallery]/0/
want redirect my.website.com. can fine index.php, it's parts aren't working. i've tried:
rewritecond %{http_host} ^my.website.com$ [nc] rewriterule (.*) http://my.website.com/index.php#!lightbox[gallery]/0/? [r=301,l]
and cpanel generated following redirect:
rewritecond %{http_host} ^my.website.com$ [or] rewritecond %{http_host} ^www.my.website.com$ rewriterule ^/?$ "http\:\/\/my\.website\.com\/\#\!lightbox\[gallery\]\/0\/" [r=301,l]
both output my.website.com/%23!lightbox[gallery]/0/
url - can see hash isn't being processed.
if has ideas i'd love hear!
thanks :)
have rules this:
options +followsymlinks -multiviews rewriteengine on rewritecond %{http_host} ^(www\.)?my\.website\.com$ [nc] rewriterule ^/?$ http://my.website.com/index.php#!lightbox[gallery]/0/ [r=301,l,ne]
you need escape dot .
in rewritecond don't need escape special characters on rhs. importantly need have flag ne
not escape resulting uri.
Comments
Post a Comment