I normally use .htaccess files to rewrite URLs. You don't have to modify your httpd.conf file and it can be done per directory in case you have multiple sites on your server.
The trick is to make sure that mod_rewrite is enabled in apache and also there is another config option I ran into (can't remember exactly what it's called) that will try to guess which file you're trying to get if you typed something wrong... so say you try to goto domain.com/pictures and there is no pictures directory but there is a pictures.html apache will return that .html file. So, in short, make sure that option is turned off in your config - sorry I can't remember.
Anyway, here is a sample of one of my .htaccess files:
-
RewriteEngine on
-
-
RewriteRule ^([A-Za-z0-9-]+)/?$ index.php?site_action=$1 [L]
-
The above rule is placed in .htaccess in the main directory of my website. If someone goes to mysite.com/home apache pulls up mysite.com/index.php?site_action=home without changing the address bar. One thing to remember, if you're using relative links in your images like:
- <img src="images/image.jpg">
Your images won't display because your browser thinks that you are in a subdirectory (home in my example above) so it looks for "mysite.com/home/images/image.jpg". To fix this, put a leading slash in front of the image:
- <img src="/images/image.jpg">
Remember this for any type of link/file you're referencing, a javascript, style sheet, flash movie, etc. Always have that leading slash so the server knows to start at the root of the web server.
Also, ilovejackdaniels.com has a great mod_rewrite cheatsheet. Check that out for a quick reference --
http://www.ilovejackdaniels.com/chea...e-cheat-sheet/
Thescripts.com rewrite script probably looks something like this for their forum redirects:
-
RewriteEngine on
-
-
RewriteRule ^thread([0-9-]+).html?$ showthread.php?p=$1 [L]
-