Note that there are some explanatory texts on larger screens.

plurals
  1. POSEO mod_rewrite internal uri directory problems
    primarykey
    data
    text
    <p>I have a mod_rewrite rule that changes <code>example.com/en/about/topic</code> to <code>example.com/en/view.php?p=pages/about/topic.php</code></p> <p>My rule is: </p> <blockquote> <p>RewriteRule ^en/([a-zA-Z0-9/]+)$ en/view.php?p=pages/$1.php</p> </blockquote> <p>view.php has all my persistent stuff like menus, logo etc and it uses a php include to get pages/topic.php</p> <p>It works on <code>example.com/en/topic -&gt; example.com/en/view.php?p=pages/topic.php</code> but when I try <code>example.com/en/about/topic -&gt; example.com/en/view.php?p=pages/about/topic.php</code>, it finds <code>view.php</code> and <code>pages/about/topic.php</code> and loads them but tries to load all my css files and images etc. from <code>en/about/...</code> instead of <code>en/...</code> It does this for images in both view.php and topic.php. The most frustrating thing is that if I add [R] to the rule, everything works fine but it defeats the purpose of the SEO exercise!</p> <p>I’ve been at this all day but no luck. Though I did discover mod_rewrite logging and a couple of <a href="http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/#gen3" rel="nofollow">handy</a> <a href="http://www.addedbytes.com/cheat-sheets/mod_rewrite-cheat-sheet/" rel="nofollow">guides</a>.</p> <p>Here’s what my log says for example.com/en/test (which works):</p> <blockquote> <p>[perdir C:/tt/xampp/htdocs/] rewrite 'en/test' -> 'en/view.php?p=pages/test.php'</p> <p>[perdir C:/tt/xampp/htdocs/] strip document_root prefix: C:/tt/xampp/htdocs/en/view.php -> /en/view.php</p> <p>[perdir C:/tt/xampp/htdocs/] internal redirect with /en/view.php [INTERNAL REDIRECT]</p> <p>[perdir C:/tt/xampp/htdocs/] pass through C:/tt/xampp/htdocs/en/view.php</p> <p>[perdir C:/tt/xampp/htdocs/] pass through C:/tt/xampp/htdocs/en/base/code/view.css</p> </blockquote> <p>and for example.com/en/about/test (which does not)</p> <blockquote> <p>[perdir C:/tt/xampp/htdocs/] rewrite 'en/about/dir/test' -> 'en/view.php?p=pages/about/dir/test.php'</p> <p>[perdir C:/tt/xampp/htdocs/] strip document_root prefix: C:/tt/xampp/htdocs/en/view.php -> /en/view.php</p> <p>[perdir C:/tt/xampp/htdocs/] internal redirect with /en/view.php [INTERNAL REDIRECT]</p> <p>[perdir C:/tt/xampp/htdocs/] pass through C:/tt/xampp/htdocs/en/view.php</p> <p>[perdir C:/tt/xampp/htdocs/] pass through C:/tt/xampp/htdocs/en/about</p> </blockquote> <p>Any help would be much appreciated!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload