I need to remove ?id=
and &title=
from this url using .htaccess file.
URL now - http://www.XXXX.com/video.php?id=XX&title=XXX-XXX-XXX
What I need - http://www.XXXX.com/video.php/XX/XXX-XXX-XXX
I already have removed .php from all links.
Following htaccess code will do your work
//First Parameer
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ video.php?id=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ video.php?id=$1
//Second Parameter
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)$ video.php?id=$1&title=$2
RewriteRule ^([a-zA-Z0-9_-]+)/([0-9]+)/$ video.php?id=$1&title=$2
add below code to your .htaccess
file.
RewriteEngine on
RewriteBase /
RewriteCond %{QUERY_STRING} ^id=(.*)\&title=(.*)
RewriteRule (.*) /$1/%1/%2? [NC,L,R=301]
output is
http://www.XXXX.com/video.php/XX/XXX-XXX-XXX
this code is working for me i hope it is working for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With