Hey all I want to use SEO-friendly URLs on certain pages of a website. What I want to achieve is the same thing you can do with WordPress, in other words the title of the blog post becomes the filename. For example... Original URL: www.website.com/page.php?id=54 Blog post title is "My first blog post" New URL: www.website.com/my-first-blog-post OR www.website.com/my-first-blog-post.php Does anyone know how to do this? Alternatively, is it possible to use .htaccess to change the URL to match the page title, retrieved from the <title> tag in the HTML of the page? I don't know if this is easier or more difficult... Thanks for your time
I think these kind of links generated using PHP it self.. for example. you need to generate a whole new page with php using the original php script..
For links like /post/my-post-title.php .htaccess RewriteEngine On RewriteBase /post/ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.+?).php$ /post.php?url=$1 [QSA] Code (markup): You'll have to make a column in databse where you store post urls. And then search post by this value like: $q = "SELECT * FROM `posts` WHERE url LIKE '".$_GET['url']."'"; PHP: Don't forget to sanitize $_GET['url'];