Ozgur Arslan Ozgur Arslan - 1 year ago 113
PHP Question

rewrite only subfolder not files

What I want to achieve is build urls like /profile1 /profile2 ...etc. which rewrites to profile.php?id=profile1

The code I am using currently is

RewriteRule ^(.+)$ profile.php?p=$1 [NC,QSA,L]

It works as expected but problem is It also rewrites for urls like /sp.php?e=mybids

Those Urls are also redirected to profile.php, which I don't want it to happen.

Any help?

Answer Source
RewriteRule ^([^\.]+)$ profile.php?p=$1 [NC,QSA,L]
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download