I'm getting ready to develop a web site with the following url structure.
I'm a newbie to url rewrites and would like to know the best way to handle this.
http://domain.com index.php
http://domain.com/about about.php
http://domain.com/agencies agencies.php
http://domain.com/contact contact.php
http://domain.com/publisher publisher.php
http://domain.com/publisher/sign_up publisher_signup.php
http://domain.com/agencies/sign_up agencies_signup.php
http://domain.com/agencies/login login.php
http://domain.com/advertiser advertiser.php
http://domain.com/advertiser/sign_up advertiser_signup.php
http://domain.com/advertiser/login login.php
What would be the most efficient htaccess rewriterule?
Should I just manually enter each line with a rewrite or is there some good search/replace I could use?
I'm thinking long term the number of slashes in the url could be the most 4 for example
http://domain.com/area/sub_area/sub_area2/sub_area3
Any help would be greatly appreciated.
I'm sorry but your "URL" transformation are not homogeneous (= it's not possible to "generalize" because they do not share exactly the same principles) so here's the best I could do:
But if you want "homogeneous" stuff that do not perfectly fit with what you're asking, you may have "cleaner" rules like this:
And if you really want to centralize everything, you could do (= pass the type to the
php
file):