Although I have never really found any outstanding documentation or tutorial for Apache URL Rewriting or other such .htaccess capabilities, the Apache documentation is decent, but not necessarily user-friendly:
Apache 1.3 (Apache 2.0 Guides also available, but almost the same functionality):
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
http://httpd.apache.org/docs/1.3/misc/rewriteguide.html
Other Useful References:
http://www.askapache.com/htaccess/mod_r ... ricks.html
http://www.htaccesselite.com/htaccess/
http://www.htaccesselite.com/htaccess/m ... vt101.html
The above references should get you going in the right direction, but I can also offer a little extra help.
Concerning your fake file setup, I use something similar in one of my projects and the cool thing is you do not even have to actually create the "fake" files.
I am sure this can be done several different ways, but here is one implementation to try:
- The basic layout of the .htaccess file:
- Code: Select all
# Chris's .htaccess File
# FollowSymLinks is required to run the RewriteEngine, so enable the
# option
Options -Indexes
Options +FollowSymLinks
# Activate the RewriteEngine
RewriteEngine On
# You may need to define the RewriteBase, depending on how your file
# paths relates to your web paths - see documentation
# I do not do this in my setup
#RewriteBase /
# Rewrite URL for CMS Thumbs
# Use RewriteCond to verify the URL should be redirected to thumbs
# This may not be necessary
# RewriteCond
# Rewrite Rule
RewriteRule /thumbs/(.*) /(.*)/(.*)\.jpg$
protectedimage.php?image=$1/$3.jpg_$2&cachedimage=true&width=200 [L]
# This [L] flag means this is the last rule to process
# You may want to check out some of the other flags
- Place your .htaccess file in a directory above the directory referencing the "fake" files, such as
http://www.creapsoft.co.uk/thumbs/
- Test and good luck
I imagine the sample file is not exactly correct, but hopefully it will be able to lead you in the right direction.