Deepak Dholiyan Deepak Dholiyan - 1 year ago 93
PHP Question

htaccess redirection without base name

I am handling some urls with the htaccess like below



RewriteRule ^online/(.*)/(.*)$ filename.php?key=$2 [L]

But Now I want to use some urls like below:-

How Can I do this?

Answer Source

You can use this rule-

RewriteRule ^([\w-]+)/([\w-]+)$ filename.php?key=$2 [QSA,L]
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download