0

Please help me on the RewriteRule below. I want to show the v3.php file for https://example.org/signup.

# Turn Rewrite Engine On
RewriteEngine on

# Rewrite for signup
RewriteRule ^signup v3.php [NC,L]

Works. But all other requests after /signup like /signups or https://example.org/signup/example/whatever show the v3.php as well. I need that RewriteRule only for that exact folder name.

Thanks for your help!

Robin Alexander
  • 984
  • 2
  • 13
  • 29

1 Answers1

0
RewriteRule ^signup/?$ v3.php [NC,L]

Thank you, @anubhava

Robin Alexander
  • 984
  • 2
  • 13
  • 29
  • But why allow an optional trailing slash (ie. `/?`)? That potentially creates a [duplicate content issue](https://stackoverflow.com/questions/75093583/add-trailing-slash-at-dynamic-htaccess) since both `/signup` and `/signup/` (2 different URLs) return the same response (a smaller problem than the one you were trying to solve initially). If you wish both URLs to be accessible then you should redirect one to the other (the "canonical" URL) - this would be handled by a separate rule. – MrWhite Jan 12 '23 at 17:49