Rewrite Rule mod_rewrite rule
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.
精彩评论