开发者

Rewrite Rule mod_rewrite rule

开发者 https://www.devze.com 2023-02-23 08:44 出处:网络
Please I have the following RewriteRule ^m/([a-z]+)$ view_site_public.php?site_name=$1 What I want to is to have http://www.site.com/m/cool at the address bar resolve internally to

Please I have the following

RewriteRule ^m/([a-z]+)$ view_site_public.php?site_name=$1

What I want to is to have http://www.site.com/m/cool at the address bar resolve internally to

http://ww开发者_StackOverflow社区w.site.com/view_site_public.php?site_name=cool

It is currently giving error


Try:

RewriteRule ^/m/([a-z]+)$ view_site_public.php?site_name=$1

By the way, you are only capture lowercase letters in the site name. Is that what you want?

You may also want to add [QSA,L] at the end of that RewriteRule, so that you aren't checking any other rules and so you also pass in any query string params that the user specifies.

0

精彩评论

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