Page 1 of 1

Need Help in URL Rewriting....

Posted: Fri Sep 14, 2007 12:13 am
by deepakonwww
Hello PHP Friends,

I need your help in a very crucial Issue.

Basically I am developing my site in PHP.

I want to use URL Rewriting in my site using mode_rewrite.

I want my URL in this way

http://www.mysite.com/development/php/basic/

this url should load the basic.php page from the php directory.

here the important point is if user write something like
http://www.mysite.com/development/php/basic

the slash ("/") should be added automatically to the URL.

and if user writes http://www.mysite.com/development/php

then a slash should be added to the URL and it will load the default.php page from that directory.
here you can assume that every directory contains the default page.

and if user writes http://www.mysite.com/my

then it should add the slash to the URL like this http://www.mysite.com/my/ and load the my.php page.

Hope I have made myself clear.

Please guide me in this regards.

Thanks in Advance....

Posted: Fri Sep 14, 2007 12:56 am
by Christopher
Do you want to use a Front Controller? Why do you want the slash added?

Posted: Fri Sep 14, 2007 1:16 am
by deepakonwww
I just want to show my URLs this way only, and I have seen this kind of URL Rewriting at many places.
Plese help me to implement this.
Tell me the URL Rewriting Rules.
Thanks

Posted: Fri Sep 14, 2007 3:24 am
by superdezign
Why would you want to use a default.php when you could just as easily use index.php?
And as for the other stuff, just make mod_rewrite check if that url + ".php" is a valid request and, if it is, serve that content.