Hey everyone,

I just discovered the wonders of Mod Rewrite (and I actually think I have it down pat). Anyways, it is something this forum implements "masking" the messy viewforum.php?foo=bar&foo2=bar2.

It's actually quite simple, all that you need is an apache based http server, and something to type in, notepad for windows, kate for linux.

Start up your editor and put these lines in there, don't worry I'll explain later

Code:
RewriteEngine On 
RewriteRule ^index(.*).php$ index.php?foo=$1 [L,NC]

Ok to start off,

Code:
RewriteEngine On
Just tells apache you will be "masking" some filenames.

The next line:


Code:
RewriteRule ^index(.*).php$ index.php?foo=$1 [L,NC]

Tells apache you are rewriting anything that is in the format indexbar.php to index.php?foo=bar, and that it is all being done on the local server.

Save this file as .htaccess. If you are in windows, save it as htaccess.txt then upload it, and use your ftp client's rename function to rename it to .htaccess.

So now whenever you want to pass variable "foo" with value "bar" within your page simply link to indexfoo.php.

Other forms can be created, allowing multiple variables such as:

Code:
RewriteRule ^index_(.*)_(.*)_(.*).php$ index.php?foo=$1&foo2=$2&foo3=$3 [L,NC]


That just tells apache that index_bar_bar2_bar3.php really is index.php?foo=bar&foo2=bar2&foo3=bar3.

The reason for all of this is that it is easier for google to index your pages, and MORE pages will get indexed because index.php?foo=bar and index.php?foo2=bar2&foo3=bar3 are similar and don't count as much to your innersite links (correct me if I am wrong). But indexbar.php and index_bar2_bar3.php are two dissimilar links and are treated as thus.

Hope you all like this! It works great for me