0

I want to rewrite the following: http://www.example.com/template/school.php?SchoolName=IMD

to

http://www.example.com/template/school/IMD/

Is there any problem with this:

Options FollowSymLinks -Indexes +MultiViews  
RewriteEngine On  
RewriteBase /template/  
RewriteRule ^school/(.*)/$ school.php?SchoolName=$1 [QSA,L,NC]  

I have tried everything that was available in multiple domains but somehow the URL rewrite in .htaccess is not working. Have already spent considerable time on this, any help is appreciated.

Amit
  • 1
  • 1
  • How do you see that the rewriting is not working? What should be seen on your page? – Psi Mar 19 '17 at 14:19
  • is the rewrite module is activated in apache or is it nginx or apache server? – Tamil Selvan C Mar 19 '17 at 14:23
  • 1) I think you mean it the otherway around. 2) your RewriteBase is incorrect (you don't actually need it) in this case. See http://stackoverflow.com/questions/704102/how-does-rewritebase-work-in-htaccess to learn how rewritebase actually works, – Ahmed Masud Mar 19 '17 at 14:31
  • @Psi the parameter passed in SchoolName does not reach the school page. For example, if I am passing Columbia as school name as in /template/school/columbia/...the columbia parameter is not passed, while it works in /template/school.php?SchoolName=columbia – Amit Mar 20 '17 at 13:29
  • @TamilSelvanC Yes, the rewrite module is activated, it is working for other rewrite rules in the same .htaccess – Amit Mar 20 '17 at 13:31
  • @AhmedMasud I have tried with various combinations, that includes removing the RewriteBase. still didn't work – Amit Mar 20 '17 at 13:33

0 Answers0