Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP/Htaccess - problem with a loader
    text
    copied!<p>I have an htaccess file in the root that redirects every request of a page to a specific file:</p> <pre><code>RewriteCond %{REQUEST_URI} !^/loader.php(.*)?$ [NC] RewriteRule ^(.*)$ /loader.php?url=$1 [QSA,L] </code></pre> <p>Now the redirect is easy in the <code>loader.php</code></p> <pre><code>include($_SERVER['DOCUMENT_ROOT'] . '/' . $_GET['url']); </code></pre> <p>I just include the URL,<code>admin/index.php</code> for example.</p> <p>If I leave the code as is the loader will include the file and print the correct HTML, but it will not load any CSS or JS scripts. If I put <code>echo "test";</code> just before the include, the loader will load the CSS file. It's something that is killing me. Do I have to specify something in the HTTP header?</p> <p>I already tried putting <code>&lt;base url="" /&gt;</code> in the header of <code>index.php</code> with no result, but another strange thing is that with Chrom if I inspect the page and click on the link I'll see the right CSS. </p> <hr> <p><em>Update 1</em></p> <p>I printed the <code>headers_list();</code>. I noticed one thing - when I print an <code>echo</code> in <code>headers_list</code>, an array shows the content-type, so I tried to add it on my own with the <code>header()</code> function but with no result. Still working on it.</p> <hr> <p><em>Update 2</em></p> <p>I've noticed another thing; if I put a <code>&lt;style&gt;&lt;/style&gt;</code> tag with some CSS it will work fine, but if I use the <code>&lt;link /&gt;</code> tag it doesn't. This doesn't make any sense.</p>
 

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