Mod rewrite Tutorials
overview - syntax - basic - medium - advanced
Mod Rewrite Basic tutorials
The majority of you came to this site to find out how to do one of these
basic tutorials. So lets go ahead and line up what we'll be learning.
Tutorial 1
Simple Static to Dynamic Mod Rewrites 
It's easier than you think. Out of all the rewrites I've done I'd
say I still do this type of rewrite the most. If you are working on
a non commercial web applications then you should
be able to implement this type of mod rewrite in just a few minutes.
Scenario: We have a dynamic site that out puts query
strings in the urls. We want to change these dynamic urls to static
search engine friendly urls. All the current web pages use a .php extension.
We want the urls to look like a plain html page with a .html ext.

Tutorial 2
301 and 302 redirects using mod rewrite
Redirects are some of the easiest rewrites to do. They
are very powerful so becareful. I'll just go over the most popular
and then let anyone that wants to write a note about redirects
post away after the tutorial.
Scenario 1: We have changed the file name /blue-widgets.html to
/awesome-blue-widgets.html. We need to set up a 301 permanent redirect
so any user or search engine bot that visits the old file will
be redirected to the new.
Scenario
2: We've changed our domain name. We've set up every
single file on the new domain. All the files will keep the
same name, directory structure and extensions. We need to redirect
users and search engine bots to our new domain via 301 so the
new site starts getting picked up.
Tutorial 3
File and file Extension rewrites
These rewrites in this tutorial are helpful when you are changing
old static .html files into a more dynamic server side scripting
file like .asp, .jsp, .cfm or .php. Some of these also fall under
the "if I did this it would look cool" category. Enjoy!
Scenario 1: We have a dynamic site using .php
extensions. We just want to make the site look less dynamic and
more like hand made. All the file names are staying the same, we
just want to change the extensions to .
Scenario 2: We own a music store online. For our cd catalog online
we want to change the file extensions from .php to .cds. We think
users will get a laugh if the call up the file /catalog/metalica.cds
.
<< mod rewrite syntax :: basic
mod rewrites :: medium mod rewrites >> |