Page 1 of 1

Challenging problem

Posted: Tue Feb 20, 2007 6:15 am
by dude81
Hi,
This could be challenging.
Im working on a software which should publish feed urls. Now I want a central file where I can implement the business logic so that my various links will work. The business logic will be like Ill query the database and retrieve the url_id and other parameters of the url based on which my urls will output the data. So how can I do that. The software has rewrite rules restriction.

In short , one file being called by multiple urls, and file outputs the data in according to url. Otherwise to say one script will be called when multiple urls contain some server name plus with one extrastring.

Code: Select all

http://server_name/extrastring/anythingfromhere

and extrastring index.php has the code written it so that all the urls with

Code: Select all

http://server_name/extrastring/one1
http://server_name/extrastring/kate_winslet/
http://server_name/extrastring/tom_hanks/

all of the above urls script executed in extrastrings index.php
Kindly throw some of your ideas that how one can implement this.



Thanks

Posted: Tue Feb 20, 2007 8:14 am
by feyd
I'm not understanding. Please explain more.

Posted: Tue Feb 20, 2007 8:15 am
by dude81
posted with seconds difference. I updated kindly see it now

Posted: Tue Feb 20, 2007 11:31 am
by Kieran Huggins
sounds like you want a MVC architecture - google up a tutorial

Posted: Tue Feb 20, 2007 11:38 am
by dude81
No, I heard a solution, I was meaning a use case of rewrite rules in Apache.
like
any page which comes of any of the following form

Code: Select all

http://localhost/app/a/xyz
http://localhost/app/a/abc
http://localhost/app/a/123
will be redirected to

Code: Select all

http://localhost/app/a/index.php
That is all. I found it is a use case of rewrite rule :)

Posted: Tue Feb 20, 2007 4:12 pm
by feyd
We have a lot of threads on mod_rewrite doing such things.. it has nothing to do with PHP.

Posted: Tue Feb 20, 2007 4:20 pm
by Christopher
Kieran Huggins wrote:sounds like you want a MVC architecture - google up a tutorial
Actually sounds like he wants a Front Controller with mod_rewrite and some kind of URL router/mapper. The MVC implementation is conceptually after the dispatch.