0

My htaccess file has the following two lines

RewriteRule ^payment payment.php
RewriteRule ^payment-confirmed payment-confirmed.php

When trying to access payment-confirmed.php it just goes to payment.php (payment) - I'm guessing this is because it only reads the first word and thinks it has found the location.

Is there a way I can configure my htaccess file to avoid this?

1 Answers1

1

Three different ways:

  1. Use Alias instead of Rewrite:
    Alias payment payment.php
    Alias payment-confirmed payment-confirmed.php
  1. Include a $, which means "end of the string":
    RewriteRule ^payment$ payment.php
    RewriteRule ^payment-confirmed$ payment-confirmed.php
  1. Move the lines around, so that the most specific line gets checked first:
    RewriteRule ^payment-confirmed$ payment-confirmed.php
    RewriteRule ^payment$ payment.php
Jenny D
  • 27,780
  • 21
  • 75
  • 114