I have this .htaccess file in WordPress. It\'s located at /public_html/ (web root). I need to exclude a folder (csNewsAd) from the rewrite engine. I\'ve tried this, based fr
I know its an old post, but it still helped me. I had the additional problem of several blocks of RewriteRules:
##
## White listed folders
##
RewriteCond %{REQUEST_URI} !^/(phplist|phplist/.*)$
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} !/.well-known/*
RewriteCond %{REQUEST_FILENAME} !/storage/app/uploads/.*
RewriteCond %{REQUEST_FILENAME} !/storage/app/media/.*
...
RewriteCond %{REQUEST_FILENAME} !/modules/.*/(assets|resources)/.*
RewriteRule !^index.php index.php [L,NC]
##
## Block all PHP files, except index
##
RewriteCond %{REQUEST_URI} !^/(phplist|phplist/.*)$
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} \.php$
RewriteRule !^index.php index.php [L,NC]
##
## Standard routes
##
RewriteCond %{REQUEST_URI} !^/(phplist|phplist/.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
and had to add my RewriteCond before every block...
Here is my solution with regard to the GoDaddy WordPress site. My install had a web.config file so I added a rewrite rule. I wanted an /ApiData path where I could run an MVC.net application (virtual directory) for AJAX calls.
<system.webServer>
<!-- ... -->
<rewrite>
<rules>
<rule name="apidata" stopProcessing="true">
<match url="apidata"/>
</rule>
<rule name="wordpress" patternSyntax="Wildcard">
<match url="*"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="index.php"/>
</rule>
</rules>
</rewrite>
</system.webServer>
You should try this one
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^/(gadget)/(.*) /gadget/$2 [R]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
try with this single rule :D please note that dashboard is the name of the directory I wanted to exclude so change that according to your needs.
RewriteRule ^(dashboard)($|/) – [L]
It seems to be that:
ErrorDocument 401 default
At the end of .htaccess
is the correct answer. I tried a number of solutions but then had the brain wave to check it on another browser (safari) then cleared cache and hard reload of site on chrome gave positive result (amateur mistake). Darn that caching.
On Mac (in Chrome) you need to 'control' click anywhere on the page. Then choose 'inspect' this will allow you then to 'control' click on the little circular arrow (re-fresh button) and it will give options - one is 'Empty cache and hard reload'. very useful for regaining sanity.