Reputation: 138
I have dynamic url like
http://epathasala.com/schooldetails.php?name=john-paul-higher-secondary-school
http://epathasala.com/universitydetails.php?name=demo-university
http://epathasala.com/schooldetails.php?name=tagore-international-school
I need to remove all the query string and change the url like below
http://epathasala.com/collegedetails/gtn-arts-college http://epathasala.com/universitydetails/demo-university http://epathasala.com/schooldetails/tagore-international-school
I have tried [Pretty URL - mod_rewrite question][1] But not working. Please some one help. Thanks
I have tried this below htaccess code but its not working.
RewriteEngine On
RewriteBase /
RewriteRule ^epathasala/schooldetails/(.*)$ /epathasala/schooldetails.php?name=$1 [NC,L]
I need to remove this part ".php?name=" from the url.
Upvotes: 2
Views: 426
Reputation: 41219
This should work :
RewriteEngine On
RewriteBase /
RewriteRule ^epathasala/([^/]+)/([^/]+)/?$ /epathasala/$1.php?name=$2 [NC,L]
Upvotes: 0