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
Post a Comment