Jump to content

Excluding a directory


FrontRunner

Recommended Posts

Hi everybody,

This is my first post on this forum as I don't know how to solve a problem. As co-owner of a website named GamersNation I got a problem with the .htaccess file in the root of our server. What I´m trying to do to exclude a folder named /Links/ from the rewriterules that are in the file. Currently all files with the .html extension are being parsed as being part of a Dragonfly Module, but what I would like to happen is that every .html file from the /Links/ folder is parsed as a .html file.

For example:

http://www.gamersnation.co.uk/links/links.html (now gives an error) but the links.html file is certainly in place.

I hope you can help me out. Please find below the .htaccess file

[code]# CPG Dragonfly CMS
# Copyright (c) 2004-2005 by CPG-Nuke Dev Team, dragonflycms.org
# Released under the GNU GPL version 2 or any later version

# $Source: /cvs/html/.htaccess,v $
# $Revision: 9.13 $
# $Author: djmaze $
# $Date: 2005/09/06 00:48:38 $

# Remove the pound sign on these 3 for production sites
# if your server doesn't allow it then a Error 500 is given
# php_flag display_errors off
# php_value error_reporting 0
# php_flag register_globals 0

# deny most common except .php
<FilesMatch "\.(inc|tpl|h|ihtml|sql|ini|conf|bin|spd|theme|module|exe)$">
  deny from all
</FilesMatch>

# disable access to config.php and .ht* from a browser
<FilesMatch "^(config\.php|\.ht)">
Deny from all
</FilesMatch>
<FilesMatch "error\.(php|gif)">
allow from all
</FilesMatch>

# if you use LEO, mod_rewrite is necessary
<IfModule mod_rewrite.c>
  RewriteEngine On

# re-direct specific parked domains to their appropriate sub-domain

  RewriteCond %{HTTP_HOST} ^etnation\.co\.uk$ [OR]
  RewriteCond %{HTTP_HOST} ^www\.etnation\.co\.uk$
  RewriteRule ^.*$ http://et.gamersnation.co.uk%{REQUEST_URI} [R=301]

  ReWriteCond %{HTTP_HOST} ^etqwnation\.co\.uk$ [OR]
  ReWriteCond %{HTTP_HOST} ^www\.etqwnation\.co\.uk$
  ReWriteRule ^.*$ http://etqw.gamersnation.co.uk%{REQIEST_UIR} [R=301]

  RewriteCond %{HTTP_HOST} ^bf2nation\.co\.uk$ [OR]
  RewriteCond %{HTTP_HOST} ^www\.bf2nation\.co\.uk$
  RewriteRule ^.*$ http://bf2.gamersnation.co.uk%{REQUEST_URI} [R=301]

  RewriteCond %{HTTP_HOST} ^bf2142nation\.co\.uk$ [OR]
  RewriteCond %{HTTP_HOST} ^www\.bf2142nation\.co\.uk$
  RewriteRule ^.*$ http://bf2142.gamersnation.co.uk%{REQUEST_URI} [R=301]

  RewriteCond %{HTTP_HOST} ^dodsnation\.co\.uk$ [OR]
  RewriteCond %{HTTP_HOST} ^www\.dodsnation\.co\.uk$
  RewriteRule ^.*$ http://dods.gamersnation.co.uk%{REQUEST_URI} [R=301]

  RewriteCond %{HTTP_HOST} ^fearnation\.co\.uk$ [OR]
  RewriteCond %{HTTP_HOST} ^www\.fearnation\.co\.uk$
  RewriteRule ^.*$ http://fear.gamersnation.co.uk%{REQUEST_URI} [R=301]

# re-direct 'my' sub-domain to user account

  ReWriteCond %{HTTP_HOST} ^my\.gamersnation\.co\.uk$
  ReWriteRule ^.*$ http://www.gamersnation.co.uk/index.php?name=Your_Account [R=301]

# re-direct ~username to specific user account

  ReWriteRule ^~(.*) http://www.gamersnation.co.uk/index.php?name=Your_Account&op=userinfo&username=$1 [L]

  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^(.*)$ - [L]

  # Check for Santy Worms and redirect them to a fail page
  #-------------------------------------------------------------------
  # Variant -1
  # uncomment if you dont use LWP
  # RewriteCond %{HTTP_USER_AGENT} ^LWP            [NC,OR]
  # Variant -2
  RewriteCond %{REQUEST_URI} ^visualcoders                [NC,OR]
  # Variant -3
  RewriteCond %{QUERY_STRING} rush=([^&]+)                [NC]
  # deny them
  RewriteRule ^.*$ - [F]
  #-------------------------------------------------------------------

  # if you use LEO and CPG-Nuke is installed in a sub-directory like '/html',
  # remove that # before RewriteBase and rename /html to the path of the sub-directory
  # RewriteBase /html
  # RewriteRule ^index\.html /index.php
  RewriteRule ^([a-zA-Z0-9_=+-]+)(/|\.html)$ index=$1 [L,S=5]
  RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)(/|\.html)$ index=$1&file=$2 [L,S=4]
  RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ index=$1&file=$2 [L,S=3]
  RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/(.*)(/|\.html)$ index=$1&file=$2&$3 [L,S=1]
  RewriteRule ^([a-zA-Z0-9_]+)/(.*)(/|\.html)$ index=$1&file=index&$2  [L]
  RewriteRule ^index=(.*[^/])/(.*) index=$1&$2 [N,L]
  RewriteRule ^index=(.*) index.php?name=$1 [L]
</IfModule>

# use custom error pages if you wish
ErrorDocument 400 /error.php
ErrorDocument 401 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php
ErrorDocument 500 /error.php

# disallow index viewing (like ftp) of directory
# Remove # for production sites
# Options -Indexes

# for hosts that don't allow the above, we won't give people anything to look at
<IfModule mod_autoindex.c>
IndexIgnore *
</IfModule>

AddDefaultCharset utf-8
[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.