logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Mod_rewrite - How to exclude a file from being rewritten
Author
flatcircle



Joined: 27 Jun 2006
Posts: 79

PostPosted: Tue 08 Sep '09 14:20    Post subject: Mod_rewrite - How to exclude a file from being rewritten Reply with quote

Hello

I'm using following rules in my htaccess file. (default Joomla rules)

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

How can I exclude my main (root) index.htm file from this rewriting?
I don't want to change the behaviour of the existing rules, ONLY leave /index.htm as it is.

Is this possible?

Regards.
FC.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 08 Sep '09 17:26    Post subject: Reply with quote

well, this says NOT to act on /index.php
RewriteCond %{REQUEST_URI} !^/index.php

So why not add to the mess
RewriteCond %{REQUEST_URI} !^/index.htm
Back to top
flatcircle



Joined: 27 Jun 2006
Posts: 79

PostPosted: Wed 09 Sep '09 8:32    Post subject: Reply with quote

Already tried this but no success.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Wed 09 Sep '09 10:19    Post subject: Reply with quote

Code:

RewriteRule ^/(dir_name|file_name\.extension|and_so_on) - [L]

(this is for use with httpd.conf)

For htaccess, use:

Code:

RewriteRule ^(dir_name|file_name\.extension|and_so_on) - [L]
Back to top
flatcircle



Joined: 27 Jun 2006
Posts: 79

PostPosted: Fri 11 Sep '09 8:42    Post subject: Reply with quote

Thanks.
Working now.

(Problem was a (very) buggy SEF-component that caused this trouble.)
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 11 Sep '09 23:13    Post subject: Reply with quote

I should know better than to guess and leaves these kinds of questions to the config king James! Cool
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Sat 12 Sep '09 18:33    Post subject: Reply with quote

Config maybe. Rewrite not, but I'm good at googling Wink
Back to top


Reply to topic   Topic: Mod_rewrite - How to exclude a file from being rewritten View previous topic :: View next topic
Post new topic   Forum Index -> Apache