html - htaccess rewrite only when there is a query -


i having trouble rewrite rule im creating small website friend website has basic profile pages employees , im looking way create links facebook style link.

i have

rewriterule ^([^/]*)$ /staff_profile.php?staff=$1 [l]  

which redirects pages staff_profile.php, need redirect when link entered http://example.com/j.smith redirect john smiths page,

but when http://example.com/whateverpage.php accessed need show page not staff_profile.php

you can use:

rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/]+)/?$ /staff_profile.php?staff=$1 [l,qsa] 

this skip above rewriterule if request if valid file/dir.


Comments

Popular posts from this blog

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

java.util.scanner - How to read and add only numbers to array from a text file -