General mod_rewrite help

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

General mod_rewrite help

Postby rotwyla98 » Sat Mar 03, 2007 9:06 pm

I have a page that is index.php?article=33 firstly, any way I can make it so that it is /article-title/ by reading from mysql the title of the article? If not, how can I change it to /article/33/

Thanks
rotwyla98
 
Posts: 6
Joined: Fri Feb 16, 2007 10:20 pm

Advertisement

Postby dcz » Sun Mar 04, 2007 4:49 pm

URL rewriting is performed in two steps, first the url rewriting itself, where we manage to transform the url outputted by the script, and then, mod_rewrite itself, where we set up some rewriterules to have our new url working.

So I cannot tel about your script without knowing a bit more about it.

What is for sure is, it will be more code changes to go for the following rewriting :

index.php?article=33 => /article-title/

Than this one :

index.php?article=33 => /article-title/33/

As the article=33 GET var suggest the scritp is selecting on IDs. You'd need to change the db settings to perform a select on the title instead.
to be able to use index.php?article=article-title

The second one should be easier to put together, but it depends on your script.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21219
Joined: Fri Apr 28, 2006 9:03 pm


Return to Apache mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests