Mod-Rewrite URLs by 7Shadows
7Shadows

Mod-Rewrite URLs

by 7Shadows in Tutorials

Rewriting your URLs to /thissexyurl instead of index.php?url=thissexyurl is quite simple:

1) At the root of every server, you will find or you will have to create a .htaccess

2) In that file, put this code of mine:

ReWriteEngine On
#-------------------------------------------------------------------
# page/id/id2 instead of page.php?id=id&id2=id2
#-------------------------------------------------------------------

RewriteRule ^([a-zA-Z0-9_-]+)[/]?([a-zA-Z0-9_-]*)[/]?([a-zA-Z0-9_-]*)[/]?$ /index.php?page=$1&id=$2&id2=$3


3) What the codes mean is that every link separated by "/" will go to index.php
( Example: /page/id/id2 will go to index.php?page=page&id1=id1&id2=id2 )

Voila!

  • Copy Link:
  • SN Code: