Well, mod rewrite is to change file names and make it look more search engine friendly. For instance, this forum uses complex url when you go to a specific forum or view a topic. Look at the address bar. It is something like [http://www.quantumcloud.com/forum/viewtopic.php?t=367] right? This is not very search engine friendly. Because the difference between one topic page and another is only a variable! On the other hand if the url was something like [http://www.quantumcloud.com/forum/topic-2004.htm] and [http://www.quantumcloud.com/forum/topic-2005.htm] etc then it would be much more search engine friendly and google would remember it for a longer time. Changing the whole phpbb code to generate url like that is impossible. But with the help of modrewrite you can do it! That's the main benefit of mod rewrite.
Mod rewrite only works on apache based server and it has to be turned on from http.conf as redsky says.
Example of how to write mod rewrite:
| Code: |
RewriteEngine On
RewriteRule ^index(.*).php$ index.php?foo=$1 [L,NC] |
RewriteEngine On Just tells apache you will be "masking" some filenames.
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 main functions that you can use with mod rewrite are:
RewriteEngine
RewriteOptions
RewriteLog
RewriteLogLevel
RewriteLock
RewriteMap
RewriteBase
RewriteCond
RewriteRule
You can read details on them here:
[http://www.apacheref.com/ref/mod_rewrite.html]
Mod rewrite home page is of course, [http://www.modrewrite.com/] 
_________________
Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.