Taylor
Taylor

Reputation: 773

PHP equivalent to asp.net routing

Is there an equivalent to ASP.NET routing in PHP. I am working on an online math dictionary in PHP and can't find any equivalent to ASP.NET routing for PHP. I want to be able to go to example.com/dictionary/word and have the word come up in a dynamically generated page from a database. I have been trying to figure out how to make a file similar to the global.asax file in php but can't find what I want. Any help would be great

Upvotes: 1

Views: 256

Answers (2)

ymas
ymas

Reputation: 574

Take a look at Aura.Router:

https://github.com/auraphp/Aura.Router

It allows you to do URL routing in PHP.

This will require minimal URL rewriting setup.

Upvotes: 1

Colin Schoen
Colin Schoen

Reputation: 2592

This isn't something you can do in PHP, but rather you are going to need to use the Apache ModRewrite module in a .htaccess file to configure your custom routing.

Here is a good tutorial on how you can configure this:

http://code.tutsplus.com/tutorials/using-htaccess-files-for-pretty-urls--net-6049

Upvotes: 0

Related Questions