HTACCESS - Directory deletion condition

Asked

Viewed 247 times

2

Good night!

I am with the following scenario in an application:

I’m redirecting all requests to my index.php and treating URL’s through the application:

    RewriteCond %{REQUEST_URI} !admin
    RewriteCond %{REQUEST_URI} !\.(gif|jpg|png|css|js|etc|flv|swf|mp4|mov|ttf)$ [NC]
    RewriteRule (^.*) index.php [L]

I’m terrible with regular expressions, to this day I don’t understand this alien language, but I really need to solve this problem.
All my frontoffice is prepared for Friendly URL, but the admin doesn’t, so I needed this rule not to apply to the admin directory. When I send parameters to /admin/? Area=Login, for example, it works. If I type only /admin/ apache applies the rule. If I pass a parameter that is via GET apache does not apply.

Thank you in advance, Renan Mazo

  • Add that before the rest: RewriteCond %{REQUEST_URI} !^/caminhoExcecao

1 answer

2

Add a. htaccess file to the /admin folder/

In this file, just put the command to disable mod_rewrite:

RewriteEngine off
  • Daniel, I tried but it wasn’t. I believe that since the parent . htaccess handles all URL’s, the /admin/ directory doesn’t even get accessed, making the . htaccess from it useless, no?

  • Post in your question, the htaccess content of the root folder.

  • ????????????????

  • The one I posted is the contents of . htaccess on htdocs.

  • Thanks, Daniel. My case similar to Renan’s, and putting another htaccess in the printer I wanted, worked. I was even thinking of doing a Gambi, of having PHP record exceptions allowing access to the folders I wanted. : D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.