I am trying to change URL with htaccess. I have found similar questions here but they cannot work in my case.
My current url is:
website.com/find-our-office-near-you/index.php?sn=visit-our-office-in-Auburn-36801-Alabama
How i want it to look:
website.com/find-our-office-near-you/Visit-our-Office-in-Auburn-36801-Alabama
You can use the following Rule in .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?sn=$1 [L,QSA]
UPDATE Paste the htaccess in the same folder like below
find-our-office-near-you
- index.php
- .htaccess
This will use the url like
http://localhost/find-our-office-near-you/Visit-our-Office-in-Auburn-36801-Alabama
Try this:
RewriteEngine On
RewriteRule ^/?find-our-office-near-you/(.*?),(.*?)/?$ /find-our-office-near-you/index.php?sn=$1-$2 [L]