arshie92
arshie92

Reputation: 73

Rewrite in htaccess doesn't applying css with 2 parameters

Here is my htaccess content file.

Options +FollowSymlinks
RewriteEngine On

RewriteCond %{REQUEST_URI} !\.(?:css|js|jpe?g|gif|png)$ [NC]

RewriteRule ([a-z]+)$ astc/accueil.php?page=$1 [L]
RewriteRule ([a-z]+)/([1-9]+)$ astc/accueil.php?page=$1&id=$2 [L]

When I access to a page with one parameter like "localhost/assoc/accueil", I have no problem but for a page with 2 parameters like "localhost/assoc/accueil/2" The CSS isn't applying.

Any idea please ? Thanks.

Upvotes: 0

Views: 76

Answers (2)

arshie92
arshie92

Reputation: 73

Finally I use @Dave's solution by using full http link. Thanks to all of you.

Upvotes: 1

BeetleJuice
BeetleJuice

Reputation: 40936

The basic problem is that because rules are evaluated from top to bottom, localhost/assoc/accueil/2 will match the first rewrite rule so the last one never gets applied.

There are a few ways to fix it, but a simple way is:

  1. reverse the order of your rules, so the more specific path occurs first
  2. Replace [L] flags with [END]

The CSS isn't applying.

I don't know what your problem has to do with CSS. Maybe I missed something

Upvotes: 1

Related Questions