.htaccess and mod_rewrite help with multiple variables
-
Hello Everyone,
I need your help!
#I already have this in my .htaccess file, for my site from a wordpress install
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# I also have permalinks activated to cleanup unfriendly URLS like the ones below but are not working for custom PHP code that I wrote below into a file.# This is what I need help with
# My URL
# https://website.com/service-areas/?state=MyState&city=MyCity#I would like the above path to look like this:
# https://website.com/service-areas/MyState/MyCity# If this only works once, I need two different mod_rewrites to turn the ?state=MyState into /MyState
# and then the second one from &city=MyCity into /MyCity#I’m not sure if I need RewriteCond and/or RewriteRule ‘s
#I have PHP “GET” from the URL what ever the “?state=” and “&city=” holds and need to know if this will continue to work as well with the code you provide.
Thanks
- The topic ‘.htaccess and mod_rewrite help with multiple variables’ is closed to new replies.