Reputation: 31
I would like to apply the following htaccess rule only if there is a value after the forward slash of /events/
If I visit /events/
(Don't do anything. DO NOT apply the htaccess rule)
But if I visit /events/this-can be-anything/
(Apply the htaccess rule below)
RewriteRule ^events/(.*) /lp/events/index.php [L]
This is obviously not working.
Upvotes: 3
Views: 308
Reputation: 41229
You need to change your regex pattern (.*) to (.+) to match at least one character after the uri.
RewriteRule ^events/(.+)$ /lp/events/index.php [L]
Upvotes: 1