Jump to content


[PHP] [HTACCESS] URL Problem


1 reply to this topic

#1 Jackdawhouse

    Young Padawan

  • Members
  • Pip
  • 11 posts

Posted 13 June 2008 - 07:31 PM

Hello guys.

I have searched the corners of this forum and cannot find a correct answer for this (well, a working correct answer). I want to change the URL:

Quote

index.php?id=1

to...

Quote

/article-id-1/

Now I know that's done using some sort of mod_rewrite rule in .htaccess, but I have tried to find a lot of information out and no such luck as of yet.

So far, all I understand is:

RewriteEngine On
RewriteRule ^(.*)/ index.php?id=$1

But I can't figure it out. Does anybody know?

Thanks.

Edited by Jackdawhouse, 13 June 2008 - 07:32 PM.


#2 Rcty

    Young Padawan

  • Members
  • Pip
  • 3 posts
  • Gender:Male

Posted 21 June 2008 - 12:26 PM

I believe that changing it to:

RewriteEngine On
RewriteRule ^article-id-(.*)/ index.php?id=$1
Will fix your problem.

Edited by Rcty, 21 June 2008 - 12:26 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users