I'm trying to make a backend for a site to work with URL friendly. What I'm trying to accomplish is that everything after http://account_name/backend will be redirected to index.php (and that file will take care of the querystring), but if a user is not logged in, index.php will redirect to login and that URL should point to a login.php file.
At this point if I hit http://account_name/backend, I'm being redirected to http://account_name/backend/login and I see the login.php file, but the js and css recources are not loaded. This resources are beeing called like:
<script type="text/javascript" src="js/jquery.js"></script> Obviously I'm having some path issues, but I can't figure it out. I've tried setting RewriteBase in htaccess and base href in HTML but with no luck.
Also, I should mention that if try to access a js directly I'm being redirected to
http://account_name/backend/js/jquery.js > http://account_name/backend/js/login The files for the front are in:
D:\FolderA\FolderB\AccountName\Project The files for the backend are in:
D:\FolderA\FolderB\AccountName\Project\backend This is my virtual host:
<VirtualHost account_name> DocumentRoot "D:\FolderA\FolderB\AccountName\Project" <Directory "FolderA"> AllowOverride All </Directory> </VirtualHost> This is my .htaccess so far:
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{ENV:REDIRECT_STATUS} !^[\s/]*$ RewriteRule ^ - [L] RewriteRule ^login$ login.php [L] RewriteRule ^(.*)$ index.php?route=$1 [L,QSA]
<path>/loginpages? None of the given rules is supposed to be doing that.header("location: login");http://account_name/backend/loginin the address bar