Warriorpt Posted June 10, 2008 Share Posted June 10, 2008 Hi again, in my website i put this in .htacess RewriteRule ^news/([0-9]+)$ ?k=news&id=$1 in the .php file i have <a href="<?php sUrl(); ?>/news/<?php echo $news_rows['id']; ?>"> THIS WORKS!! but, i want to put this working with. <a href="<?php sUrl(); ?>/news/<?php echo $news_rows['id']; ?>-<?php echo $news_rows['title']; ?>"> to do this: /new/1-titulo_aqui_né or /new/1-titulo_aqui_né.htm Somethink like this Thks in advance Quote Link to comment https://forums.phpfreaks.com/topic/109655-rewrite-new-title/ Share on other sites More sharing options...
jamieburchell Posted June 13, 2008 Share Posted June 13, 2008 Hi How about something like this: RewriteRule ^news/([0-9]+)-([a-zA-Z0-9-]+)/?$ ?k=news&id=$1&title=$2 Your url would need to look like news/1-my-news-item/ In your code you would then use $_GET[‘id’] and $_GET[‘title’] Jamie. Quote Link to comment https://forums.phpfreaks.com/topic/109655-rewrite-new-title/#findComment-564727 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.