Nested URLs and Rewrite rules in Apache2
Posted
by Radha Krishna. S.
on Stack Overflow
See other posts from Stack Overflow
or by Radha Krishna. S.
Published on 2009-09-16T01:27:37Z
Indexed on
2010/06/13
11:02 UTC
Read the original article
Hit count: 456
Hi,
I need some help with rewrite rules and nested URLs.
I am using TikiWiki for my website and am in the process of setting up SE friendly URLs for my projects. Specifically, I have the following rewrite rule for www.example.com/projects to point to a page that lists out all the projects hosted in example.
RewriteRule ^Projects$ articles?type=Project [L]
This works fine.
Now, I would like to point www.example.com/projects/project1 to point to a specific project. I have this rewrite rule
RewriteRule ^(Projects/Project1)$ tiki-read_article.php?articleId=6
This works, but partially. The content is all rendered as text but the theme - images/ css etc all go for a toss - the page is completely in text.
I understand that this happens 'cause the relative paths in the theme/ css/ images all refer to Projects as the base folder instead of the root of the website.
I don't want to touch the CMS portion - change the theme/ css/ image paths in the files, more for reasons of upgradability.
Can someone help me understand and write a rule so that the above nested URL works?
Regards, Radha
© Stack Overflow or respective owner