0

I would like to change a url like

http://mydomain.xx/details.php?title=Hilton+Knoxville 

into

http://www.mydomain.xx/detail.php/hilton-knoxville 

using the .htaccess file.

Can someone help me to write it ?

0

1 Answer 1

1

You can use the following code in your /.htaccess :

RewriteEngine On
RewriteCond %{THE_REQUEST} /details\.php\?title=([^&\s]+) [NC] 
RewriteRule ^details.php$ /%1? [NE,NC,R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ /details.php?title=$1  [QSA,L,NC]
Sign up to request clarification or add additional context in comments.

1 Comment

i need to something like this mydomain.xx/detail/hilton-knoxville . can you tell me how to do this ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.