开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜