0

I would like to improve my site by using the page title instead of the php get method.

What do I need to write in .htacces if i would convert /index.php?id=1 to /page

Arrow
  • 1
  • 1
    Gonna need more than just mod_rewrite unless you're intending to write a rule for every single page id. `index.php` will need a way to map every *fake* URL to the actual page id, normally with a sort of db lookup table :see http://stackoverflow.com/questions/18406156/redirect-all-to-index-php-htaccess/18406686#18406686 for the rewrite part. – CD001 Mar 04 '15 at 16:36
  • This is better grammar, I formatted the code. "using the page title instead of the php" should be clarified – Félix Adriyel Gagnon-Grenier Mar 05 '15 at 20:55

1 Answers1

0
RewriteRule ^page$ /index.php?id=1 [L]

if you want to rewrite every index.php?id=ID_HERE use this:

RewriteRule ^page/([^/]*)$ /index.php?id=$1 [L]
Smugglaren
  • 99
  • 1
  • 7
  • Whilst, technically, this would work every single page would need mapping in the .htaccess file; *page2* => `index.php?id=2` ... *page3* => `index.php?id=3` and so on. It's a little ... inelegant. – CD001 Mar 04 '15 at 16:54