I've been working on this URL rewriting .htaccess code but some people have said that I am doing it wrong or backwards:
RewriteEngine On
RewriteCond %{THE_REQUEST} /index\.php\?(.*)p=(?!admin)(?!superadmin)((?![^&]*?edit)[^\s&]+) [NC]
RewriteCond %{THE_REQUEST} /index\.php\?(.*)p=([^&\ ]+)&?([^\ ]*) [NC]
RewriteRule ^ /%2?%1%3 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ index.php?p=$1 [L,QSA]
Ultimately I want the user not to see the links with query strings but I need the query strings to still exist and be usable somehow so that I can check for values of $_GET variables.
In other words I need this: - domain.com/index.php?p=Home to be rewritten as domain.com/Home - domain.com/index.php?p=Bio to be rewritten as domain.com/Bio - when a user clicks a link from the home page that points to domain.com/index.php?p=Bio they should see domain.com/Bio in the browser's url bar but I should still be able to echo $_GET['p'] and get 'Bio' when I land on the Bio page.
Make sense?
Thanks for your help in advance!