suttercain Posted August 1, 2007 Share Posted August 1, 2007 Hi guys, I was talking with a client tonight and he asked me to do two things for him (he has a movie database). 1. Put the title of the films in the <title> tags. DONE. 2. Put the title of the movie in the actual url... http://www.mysite.com/movies/movietitle/ Is number two possible without having the .php on the end of the extension? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/62782-solved-posting-the-title-of-a-page-in-the-url/ Share on other sites More sharing options...
teng84 Posted August 1, 2007 Share Posted August 1, 2007 use modrewrite Quote Link to comment https://forums.phpfreaks.com/topic/62782-solved-posting-the-title-of-a-page-in-the-url/#findComment-312568 Share on other sites More sharing options...
cgm225 Posted August 1, 2007 Share Posted August 1, 2007 use mod_rewrite Quote Link to comment https://forums.phpfreaks.com/topic/62782-solved-posting-the-title-of-a-page-in-the-url/#findComment-312569 Share on other sites More sharing options...
cgm225 Posted August 1, 2007 Share Posted August 1, 2007 see:: http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html http://en.wikipedia.org/wiki/Rewrite_engine Quote Link to comment https://forums.phpfreaks.com/topic/62782-solved-posting-the-title-of-a-page-in-the-url/#findComment-312570 Share on other sites More sharing options...
pyrodude Posted August 1, 2007 Share Posted August 1, 2007 Not to take over this topic, but is this possible without access to a .htaccess file (through php perhaps?)? I'm helping a friend of mine with a website on Yahoo webhosting, and they don't allow you to have a .htaccess file. Just curious. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/62782-solved-posting-the-title-of-a-page-in-the-url/#findComment-312624 Share on other sites More sharing options...
mrjcfreak Posted August 1, 2007 Share Posted August 1, 2007 Unless you can provide your own php error404 page, no. If you can do that, you can use PHP in the error page to look at the $_SERVER['REQUEST_URI'] value and search for the right movie. Quote Link to comment https://forums.phpfreaks.com/topic/62782-solved-posting-the-title-of-a-page-in-the-url/#findComment-312632 Share on other sites More sharing options...
DeadEvil Posted August 1, 2007 Share Posted August 1, 2007 add this code in your .htaccess file RewriteEngine On RewriteRule ^movies/movietitle$ movies/movietitle/pagename.php [L] RewriteRule ^movies/movietitle/$ movies/movietitle/pagename.php [L] Quote Link to comment https://forums.phpfreaks.com/topic/62782-solved-posting-the-title-of-a-page-in-the-url/#findComment-312659 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.