0

My URL: example.com/epathasala/**schooldetails.php**?name=st-matthews-school example.com/epathasala/collegedetails.php?name=gtn-arts-college

Expected URL: example.com/epathasala/**schooldetails**/st-matthews-school example.com/epathasala/collegedetails/gtn-arts-college

So I want to remove ?name= from the URL, Kindly Help me.

In that url query string only removed. In my case before query string also there is change.

Example Schooldetails is not static, it will change to collegedetails or events or university and so on

JGK
  • 138
  • 3
  • 15
  • Did you try existing answers such as http://stackoverflow.com/a/9310224/3749523 ? Did it help you? – Sjon Jul 22 '15 at 09:56
  • possible duplicate of [Pretty URL - mod\_rewrite question](http://stackoverflow.com/questions/3654859/pretty-url-mod-rewrite-question) – Vinie Jul 22 '15 at 10:18
  • Yes I have tried but its not working in my case – JGK Jul 22 '15 at 10:24

1 Answers1

1

This might do the trick

RewriteEngine On
RewriteBase /
RewriteRule ^epathasala/schooldetails/(.*)$ /epathasala/schooldetails.php?name=$1 [NC,L]
Professor Abronsius
  • 33,063
  • 5
  • 32
  • 46
  • RamRaider Thanks, , But schooldetails is not permanent, its a dynamic value it may change to collegedetails.php or events.php or university.php and so on – JGK Jul 22 '15 at 09:50