-2

This is my .htaccess code ... the first condition is working and the other one is not

RewriteEngine On
RewriteRule    ^([\w-]+)/?$    Page.php?PageID=$1    [L]    # Process parrots
RewriteRule    ^([\w-]+)/?$    Product.php?ProductID=$1    [L]    # Process parrots
ErrorDocument 404 /ChicDemure/404.php
Gerald Schneider
  • 25,025
  • 8
  • 61
  • 90

1 Answers1

1

The expressions in your rules are identical. Since apache can't know which one it should use it uses the first one that matches.

You have to make them distinguishable, for example like this:

RewriteRule    ^page/([\w-]+)/?$    Page.php?PageID=$1    [L]
RewriteRule    ^product/([\w-]+)/?$    Product.php?ProductID=$1    [L]

Of course you have to change the links accordingly.

Gerald Schneider
  • 25,025
  • 8
  • 61
  • 90