Frank Nwoko
Frank Nwoko

Reputation: 3934

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://www.site.com/view_site_public.php?site_name=cool

It is currently giving error

Upvotes: 1

Views: 92

Answers (1)

jmans
jmans

Reputation: 5658

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.

Upvotes: 2

Related Questions