Note that there are some explanatory texts on larger screens.

plurals
  1. POgetting error 500 with .htaccess when pointing a php file (mod_rewrite)
    primarykey
    data
    text
    <p>i made a simple .htaccess file to expose the problem.</p> <p>I want that all request made to the folder redirect to a subfolder file "app/index.php"</p> <pre><code>RewriteEngine On RewriteRule (.*) app/index.php [QSA] </code></pre> <p>And this works fine on with the basic url of my hoster (like <code>http//myname.hosting.com/htaccessFolder</code></p> <p>The problem is that i have a domain pointing on this folder, and when accessed to it, server return <code>Internal Server Error 500</code>.</p> <p>If i do this :</p> <pre><code>RewriteEngine On RewriteRule (.*) somefile.php [QSA] </code></pre> <p>Redirection works only when file does not exists (404 not found error occured). when the file exists i get a 500 error too.</p> <p>I've asked the hosting support without success for the moment..</p> <p>EDIT : </p> <p>Strangely, when i write :</p> <pre><code>RewriteEngine On RewriteRule (.*) somefile.txt [QSA] </code></pre> <p>it works on bot, so it seems that the problem comes from executing php files..</p> <p>EDIT2 :</p> <p>Here is the real .htaccess file i try to use :</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteBase / #RewriteCond %{REQUEST_FILENAME} -f #RewriteRule .? - [L] ##################### RewriteRule (.*) app/public/$1 RewriteCond %{REQUEST_FILENAME} -f RewriteRule .? - [L] RewriteRule app/public/(.*) $1 ##################### #RewriteCond %{REQUEST_FILENAME} question2answers/(.+) #RewriteRule .? - [L] ##################### #RewriteCond %{REQUEST_FILENAME} !-f #RewriteRule (.*) index.php [L,QSA] &lt;/IfModule&gt; </code></pre> <p>You can see that only the public block is not commented but when i go to the website i get this : The requested URL /cgi-bin/php5.fcgi/index.php/index.php/index.php/index.php/index.php/index.php/index.php/in.....</p> <p>but i request a file in the public folder (like <a href="http://website.com/css/style.css" rel="nofollow">http://website.com/css/style.css</a> (which is in public/css) it works as expected. When i'm not commenting the last block, i get a 500 error.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload