seventeen
seventeen

Reputation: 1531

mod_rewrite not using multiple rules

I'm still pretty lost with mod_rewrite as its incredibly new to me. I'm trying to set up a few rules for better urls. However, after playing around with it for awhile it appears that it only ever uses the first rule listed. For example, if i go to "/frontpage/some-post-slug" it works perfectly but if i go to "/page/some-page-slug" I get a 500 Internal Server Error. Does anyone have any idea what would be causing this?

my .htaccess file is in full below:

<IfModule mod_rewrite.c>

    Options +FollowSymLinks

    RewriteEngine on

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^frontpage/([A-Za-z0-9-]+)*$ /frontpage/?slug=$1 [NE,L]
    RewriteRule ^page/([A-Za-z0-9-]+)*$ /page/?slug=$1 [NE,L]

</IfModule>

Thanks for any help!

Upvotes: 0

Views: 382

Answers (1)

Ben
Ben

Reputation: 11188

What happens if you remove the * before the $-sign? I never use them and my rules are pretty much the same as yours.

Upvotes: 1

Related Questions