First, I used:
- Code: Select all
RewriteRule ^tkf/(.*)/$ tkf/index.php?page=$1 [L]
My working directory here is tkf but I plan to change that. I soon noticed that my css, js, and images were not showing up.
I then added these two rules to make them show up:
- Code: Select all
#other files
RewriteRule ^tkf/(.*)/(.*)(\.css)|(\.js)|(\.html)|(\.txt)|(\.ico)$ tkf/$2$3 [NC]
#images folder
RewriteRule ^tkf/(.*)/images/(.*)$ tkf/images/$2 [L]
But now I have problems with relative links! Every page has navigation with anchors with href="news/", href="contact/" etc. etc. Whenever your in a folder the links look like tkf/contact/news.
I know there must be a better way to be doing this. I've seen a little about using some variables (like REQUEST_URI) but nowhere have I found just a simple explanation on how to implement this.
I'm probably going about this wrong so I need to be pointed in the right direction.
Please help.