evuez
evuez

Reputation: 3387

URL Rewriting, many "folders" to variable

I am rewriting some url on my website, and I get a problem with my second rewriting rule:

RewriteRule ^(fr|en)/(home|works|contact|service)$ /index.php?language=$1&page=$2 [L]

When I try to reach this page, the page content is well-loaded, but the css is not. My stylesheet is in resources/css/, and when I go to a page like website.net/en/works, it is loaded from en/resources/css.

My others rewriting rules are the following:

RewriteRule ^(fr|en)$ /index.php?language=$1 [L]
RewriteRule ^(fr|en)/(home|works|contact|service)$ /index.php?language=$1&page=$2 [L]
RewriteRule ^(fr|en)/resume$ /resources/documents/$1/resume.pdf [L]

The first and last rules works fine, and I really don't understand why the second isn't working.

Thanks in advance

Upvotes: 1

Views: 113

Answers (1)

olly_uk
olly_uk

Reputation: 11865

without the HTML you are using this is only a slightly educated guess. As the css is being loaded from /en/resources/css you may want to check the url you are using for your css. If it is

<link rel="stylesheet" type="text/css" href="resources/css">

the it is loading correctly from /en/resources/css. to load from /resources/css the url needs to be

<link rel="stylesheet" type="text/css" href="/resources/css">

this will then force the load from /resources/css not /en/resources/css

that might be of help but like i said, only a guess without seeing the link tag in your html.

Upvotes: 1

Related Questions