php - Apache Rewrite URL Creating Linking Issues -
problem: rewrite url causing links break.
.htaccess has below rule:
rewriterule ^blog/([0-9]+)/[-0-9a-za-z]+$ index.php?action=blog&postid=$1\%23disqus_thread [nc]
style sheet reference in header template:
<link rel="stylesheet" type="text/css" href="style.css" />
i can click on:
domain.com/blog/1/title-of-article , file fine, style sheet link breaks
if go directly to:
domain.com/index.php?action=blog&postid=1#.uyv1mcqriso style sheet loads fine (ignore #.uyv1mcqriso, code disqus).
this breaking logo link, is:
<a href="./">
instead of taking me domain.com, it's going domain.com/blog/1/
my basic file structure is:
index.php , style.css in root, loads viewpost.php in/templates folder.
what going , how correct this?
easiest solution: set links relative domain root, fronting them slash (resp. removing dot referring current folder in link):
<link rel="stylesheet" type="text/css" href="/style.css" /> <a href="/">logo</a>
Comments
Post a Comment