Ozgur Arslan Ozgur Arslan - 3 months ago 37
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?

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