I've got a little problem with URL rewriting in my .htaccess running on my local apache. I configured the entry point of my server via symbolic link (localhost/memap/), so "memap" leads to my project root (no vhost configured).
I'm not very familiar with url rewriting, but redirecting all requests to my index.php works fine. The index.php leads to a custom request controller, that processes the request and returns the according page.
My problem now is that no js,css etc. gets loaded. I tried several RewriteRules, but don't get a solution. This is my current .htaccess file, that doesn't contain any rule for js,css etc. yet:
# Allows ModRewrite to work
Options FollowSymLinks
# Turn on rewrite engine
RewriteEngine On
RewriteBase /memap
# Redirect all requests to index
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^page/(.*)/(.*)$ index.php?page=$1&id=$2 [NC,L,QSA]
RewriteRule ^page/(.*)$ index.php?page=$1 [NC,L,QSA]
If I'm not mistaken, the rewrite conditions should lead requests for files and directory, without actual rewriting, directly to its target in case the target file/directory exists.
Unfortunately this doesn't happening. E.g. my css-file (memap.css) is reachable via "localhost/memap/css/memap.css", but the server looks up on "localhost/css/memap.css" (without my memap symlink). Accordingly the same happens with my js ("localhost/js/memap.js"). This is how include them in my html:
<script src="js/memap.js"></script>
<link rel="stylesheet" href="css/memap.css" media="screen" />
I tried a lot of things, but don't know how to achieve my goal. Does anyone have a solution to this? It's probably just a minor thing that's missing...
Thanks in advance!