PDA

View Full Version : Big .htaccess problem


falarious
05-08-2006, 11:51 PM
When search engine firendly URLS are turned on, and the following code is place in the htaccess file,


RewriteRule ^/?(admin|install)/(.*)*$ - [Last]
RewriteRule "^/?(page)/([0-9]+)-files\.html$" index.php?page=$2 [Last]
RewriteRule "^/?(category|file|type)/([0-9]+)[^/]+\.html$" $1.php?id=$2 [Last]
RewriteRule "^/?(category|file|type)/([0-9]+)/([0-9]+)[^/]+\.html$" $1.php?id=$2&page=$3 [Last]
RewriteRule "!^(images|thumbnails|files)" - [C]
RewriteRule "(images|thumbnails|files)(/[^/]+)" $1$2 [Last]
RewriteRule "!^[^/]+\.css$" - [C]
RewriteRule "([^/]+\.css)$" $1 [Last]
I noticed there was stuff wrong with my phpbb forum
According to my host,

The problem is your .htaccess file -- it has code in it which looks to be attempting to prevent hotlinking of images, but it's also preventing linking of images from your own site.

Ryan, please fix the code!!

Ryan
05-09-2006, 12:07 AM
The two lines your host is talking about is this:
RewriteRule "!^(images|thumbnails|files)" - [C]
RewriteRule "(images|thumbnails|files)(/[^/]+)" $1$2 [Last]

This will just prevent the images, thumbnails and actual files from being redirected with the mod_rewrite.

Where is your forum installed? In a sub directory similar to 'forum' or 'forums'? If so, then change this line to the top of your .htaccess file:
RewriteRule ^/?(admin|install)/(.*)*$ - [Last]
to:
RewriteRule ^/?(admin|install|forums)/(.*)*$ - [Last]

This will not redirect anything within the forums directory, or the admin and install for that matter.