vendredi 21 avril 2017

URL rewriting in PHP

Hello everyone i have made this application in PHP with different pages linked together with each other. The application is working fine,but the URL generated are a lot messy and complicated. I have three pages in my application namely

1.index.php (the default file)
2.video.php (the category page)
3.video-detail.php(the page for playing the video)

And the name of the root folder is april

Now the links which are generated for the application are.

http://localhost/april/video?cat_id=2&category=Programming-Language

Considering i am in the second page browsing some category after taking some input from the user in the first page. Now i am trying that the URL should be a lot cleaner than this. For eg: the URL should be in this format .

http://localhost/april/Programming-Language.

I know this task is achieved using .htacess, but i can't really understand it's approach. So any help regarding this topic is highly appreciated.




Aucun commentaire:

Enregistrer un commentaire