apache - Rewrite rule only on top level -
so, i'm trying out rewrite rule first time. , of cause i'm running in trubles.
when type in www.mydomain.com/index.php?name=gallery shows gallery. rewriterule i'm able make url www.mydomain.com/gallery link file. here's code:
rewriteengine on rewriterule ^([a-za-z0-9-]+)/?$ index.php?name=$1 [nc,l]
my problem cant acces subfolder (e.g. mydomain.com/admin) because rewrite rule sends me ...index.php?name=admin.
so question if there way make rewrite rule apply rootfolder or if there way take specific folders out of rule?
best regards!
you need condition skip existing files , directories rewrite.
rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^([a-z0-9-]+)/?$ index.php?name=$1 [nc,qsa,l]
Comments
Post a Comment