7

I have a .htaccess in my root of website that looks like this:

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.mydomain\.pl [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?([a-z0-9_-]+)\.mydomain\.pl [NC]
RewriteRule ^/?$ /index.php?run=places/%1 [L,QSA]

RewriteCond %{REQUEST_URI} !^/index.php$
RewriteCond %{REQUEST_URI} !^/images/
RewriteCond %{REQUEST_URI} !^/upload/
RewriteCond %{REQUEST_URI} !^/javascript/
RewriteRule ^(.*)$ /index.php?runit=$1 [L,QSA]

But when I type:

mydomain.pl/guests

I would like to go normally to actual folder guests. I understand that I need to somehow disable this rule for guests subfolder, but how do I do this?

EDIT:

I've included whole .htaccess file

Tom Smykowski
  • 25,487
  • 54
  • 159
  • 236

2 Answers2

19

I've put a htaccess in subfolder and added RewriteEngine Off and it works.

Tom Smykowski
  • 25,487
  • 54
  • 159
  • 236
  • This wont work, if the rewrite happens in the folder above. – max.haredoom Nov 14 '16 at 09:13
  • Not good solution. If the subfolder contains a foreign application which itself uses an .htaccess and overwrites it on every update, one has to modify it everytime. – StanE Dec 04 '16 at 18:45
  • 1
    There is an solution without RewriteCond: http://stackoverflow.com/a/1848579/1854856 – StanE Dec 04 '16 at 19:00
0

Add one of these

RewriteEngine On

#If the request starts with guests, then pass it through
RewriteCond %{REQUEST_URI} ^guests
RewriteRule ^ - [L,QSA]

#Or, if the request contains an existing filename or directory, pass it through
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L,QSA]
Vinko Vrsalovic
  • 330,807
  • 53
  • 334
  • 373