Problem with htaccess redirect with rewrite module
I have an old url at: http://example.com/search/admin
I want to make it go to: http://example.com/cgi-bin/admin
This is what I have so far, which could be completely wrong...
RewriteRule ^/search/admin$ https://example.com/cgi-bin/admin
The mod_rewri开发者_JS百科te is definitely on and working and I am using apache 2.2.
Little correction to Benubird post:
RewriteRule ^search\/admin\/?$ cgi-bin/admin [L]
RewriteRules never start with a slash and the redirect can be without slash.
the ^ character matches the start of a line ( or url in this case). Just a thought, but maybe your line should be:
RewriteRule ^/search/admin$ /cgi-bin/admin
Otherwise I suspect you'll either not be redirected, or be getting redirected to https://example.comhttps://example.com/cgi-bin/admin
精彩评论