I am developing a backend for a site I built for a client in PHP (which I rarely use), which is almost completed. I’m a Rails developer primarily, so I’m having a hard time not going for some bastardized version of a CRUD setup, and I am attempting to clean up the urls.
I would like my urls to be like so:
http://www.example.com/videos/name-of-video/
I plan on just taking the last bit of the url from $_SERVER['PHP_SELF'] and searching through the DB using that, but what I would like to do is throw the index.php file in the http://www.example.com/videos/ directory and have it be used when I explicitly point someone to http://www.example.com/videos/name-of-video/, if that makes sense.
Will this work as is, if I put the index.php in the /videos/ directory, or is something else needed? Is it possible to do without messing around with htaccess?
Sorry for my pathetic explanation. I hope it makes sense.
Thanks!
As per my knowledge this manipulation is not possible without touching .htaccess.
when you write the url http://www.example.com/videos/name-of-video/ your server is definitely going to look for the index.php file in the folder name-of-video folder. which does not exist.
If this task could have been achieved without .htaccess then they would have never been used.
And by the way why don’t you want to use .htaccess..??