I am using a small redirect to let my index.php resolve all parameters, but in some cases it can't find my javascript files anymore.
This small .htaccess rewrites all requests that don't exist to index.php.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1
RewriteRule ^(.*)/$ index.php/$1
A piece of my index.php where the javascript url returns index.php instead:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="scripts/jquery-1.10.2.min.js"></script>
- www.mysite.com/foo is working fine
- www.mysite.com is working as well
- www.mysite.com/foo/foo isn't working. It returns
index.phpas a javascript file when I inspect it with firebug.
Why is the relative path changed? I am redirecting to index.php so I'm expecting to be in that folder.
As an alternative: How can I get the full path of the javascript that is being requested for debugging purposes? Is there a way to find the .js requests that are being made by index.php?