views:

24

answers:

2

Hi,

I have an .htaccess file working in my website. I found out that javascript and CSS files are not called if the path of each of these files are not set to absolute. I changed all the URL paths to absolute in my smarty template and javascript files, and not it's working.

Now in for my php files, I have require_once all over many php files. I was just wondering if I also have to set the paths in the require_once to absolute? Any help is appreciated. Thanks.

A: 

require_once takes physical paths on disk, which are not affected by .htaccess.

SLaks
Hi SLaks, thanks for your immediate reply. I'll take your answer as a no. It's been bugging me for quite some time now, as there are some persistent bugs on the website I am working on. Seems like I need to focus on the other probable cause(s). Thanks once again.
Diane
You should describe the bugs; we may be able to help you.
SLaks
A: 

In your .htaccess file, above your RewriteRule directive, try the following two lines:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

That'll stop the rewrite rules coming into affect if the request is actually a file (f) or directory (d).

Martin Bean