php - mod_rewrite issue with single file no query string -
trying use mod-rewrite alter address bar versus actual page that's being loaded. works great when have query string use, need without query string, straight pretty url.
it seems without query string, straight mod_rewrites files shows actual filename extension.
here's htaccess looks like:
options +followsymlinks rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_uri} !(.*)/$ rewriterule ^(.*)$ $1/ [l,r=301] this works:
rewriterule ^admin/account/([^/]*)/$ /adminconfig/account.php?id=$1 [l] this doesn't:
rewriterule ^admin/account/$ /adminconfig/account.php [l] what's happening in address bar see:
example.com/adminconfig/account.php/ should be:
example.com/admin/account/
you need rules this. made sure multiviews off
options +followsymlinks -multiviews rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^admin/([^/]+)/?$ /adminconfig/$1.php [l] this rule should allow use url below in address bar
example.com/admin/account/
Comments
Post a Comment