So I have a website that services many schools. (www.mysite.com) and I am using mod_rewrite as a way to keep the current school in the URL (for analytics reasons)
www.mysite.com/index.php?school=Pennstate would turn into www.mysite.com/school/Pennstate/index/
www.mysite.com/faq.php?school=Pennstate would turn into www.mysite.com/school/Pennstate/faq/
This is all fine and dandy (though a bit cumbersome and error prone)
My problem is, with the rewrite rule in place the main site when a school is NOT selected cant be accessed.
RewriteRule ^school/([^/\.]+)/([^/\.]+)/?$ /$2.php?school=$1
If anyone knows of a good way to make the rewrite rule work in both instances and/or make the rewrite less error prone please let me know, OR if you know of a better way to do this (while keeping the current school in the url) please let me know.
The only solution I have come across is using www.mysite.com/school/none/index/ as the home page and thats just ugly.
Thanks in advance
Michael