HTACCESS - External File

Asked

Viewed 63 times

0

I have a file . htaccess, but if I have a file outside the folder, it does not allow me access... And I would like you to allow:

RewriteEngine on
RewriteCond $1 !^(index\.php|site|assets|fonts|images|css|js|administrar|entrada|docs|system)
RewriteRule ^(.*)$ index.php/$1 [L]

This file is at the root, where the file I want to display is also, so I can display I have to remove htaccess, but I need it to manage the administrator.

Edition: This file is at the root of the site, and needed the root of the site to have a php file, any name... and because of that did not access. But it worked. And posted the answer.

  • 1

    Your question and answers don’t make sense, access outside, or access from the . php file? I recommend that you edit the question, for now I voted to close, when the edition ends vote to reopen.

2 answers

0

Add in your . htaccess the entry below to allow access to the file arquivoPermitido.php

Order deny,allow
Deny from all

<Files "arquivoPermitido.php">
   Allow from all
</Files>
  • It didn’t work out that way.

  • You could test by adding lines Order Deny,allow and Deny from all at the beginning of the file please? I edited the answer code with these two new lines.

  • Yes I did, but it gives you no access at all...

  • And if you leave in your file . htacces only the code I put in the answer?

  • Access Prohibited!

  • Even restarting Apache? Just editing the file might not catch the changes if it doesn’t restart the server. Sorry to insist, but that solution worked for the same question in English. Sometimes it can also help you: http://stackoverflow.com/a/19623286/1639385

  • Rewriteengine on Rewritecond %{REQUEST_FILENAME} ! -f Rewritecond %{REQUEST_FILENAME} ! -d Rewriterule (.*)$ index.php/$1 [L]

  • I did it and it worked

  • 1

    Legal. Problem solved :)

Show 5 more comments

0


I worked it out this way and it worked!

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Browser other questions tagged

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