Omit a directory in htaccess with permalink

By Jesus - February 1, 2019

Hello,

Sorry, is thera a way to omit a directory in htaccess with permalinks?

Thank you!

By daniel - February 4, 2019

Hi Jesus,

So that I can better address your question, could you explain a little bit more about your setup and what you'd like to achieve? Are you trying to prevent the Permalinks plugin from redirecting URLs in a specific directory?

Thanks,

Daniel
Technical Lead
interactivetools.com

By daniel - February 5, 2019

Hi Jesus,

That's a curious issue. By default, the permalinks plugin shouldn't be interfering with unrelated directories, so I'm not quite sure what the error could be. Could you copy/paste the exact error message here for me?

Thanks,

Daniel
Technical Lead
interactivetools.com

By Jesus - February 5, 2019

Sure, just a not found error.

I removed the password protected information already, I just enable it for the screenshot. As I need to have access to it to get the screenshot

Thank you!

By daniel - February 6, 2019

Hi Jesus,

Thanks for supplying the error. Unfortunately, I wasn't able to replicate the issue you're experiencing. By default, the permalinks plugin should ignore any physical file or directory that exists. You can try to explicitly ignore that directory by updating the permalinks code in your .htaccess to something like this (the paths may be different for your installation): 

  ### Pass URL to permalinks dispatcher (do this last after any other redirects)
  RewriteRule ^permalinks_dispatcher\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !myadmin
  RewriteRule . /cmsb/plugins/permalinks/permalinks_dispatcher.php [L]

If that doesn't solve the issue, it might be easier for me to take a look directly. You can fill out the Support Request form (https://www.interactivetools.com/support/request/ - select 2nd level support) with the connection details of your site, and I'll see what I can find out.

Cheers,

Daniel
Technical Lead
interactivetools.com

By Jesus - February 11, 2019

Thank you, I just filled the form.

Jesus

By daniel - February 13, 2019

For anyone else who might encounter this issue: we narrowed the issue down to the way that this server's particular configuration was handling 401 (authorization) errors that are introduced by the password protection. We were able to resolve the issue by adding a line to the permalinks .htaccess code above the "RewriteEngine On" line so that it looked something like this:

  ErrorDocument 401 default
  RewriteEngine On
  RewriteBase /
  RewriteRule ^permalinks_dispatcher\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /cmsb/plugins/permalinks/permalinks_dispatcher.php [L]
Daniel
Technical Lead
interactivetools.com