Reputation: 89
This is my current url
https://www.example.com/content.php?q=1&s=title-sample-slug
I need to change above url using this type url
https://www.example.com/title-sample-slug
how can i do it using htaccess file. Need to hide the content.php?q=1&s=
from url in the browser.
Upvotes: 0
Views: 265
Reputation: 89
This is correct answer for my question
RewriteCond %{QUERY_STRING} q=([0-9a-zA-Z_-]+)&s=([0-9a-zA-Z_-]+)
RewriteRule content.php %2 [L,QSD]
Upvotes: 1
Reputation: 411
RewriteCond %{QUERY_STRING} q=1&s=(.+)
RewriteRule content.php %1 [L]
Upvotes: 1