Reputation: 1786
I have a directory with a lot of php files. But now I'm not using them anymore, so I want to redirect to my new url.
When the file exist I'm doing this:
RewriteRule client/z_([^/]*) redirect.php [L]
But how can I redirect when there's no file?
ie:
the file client/z_123.php exists and it works.
but the file client/z_321 doesn't exist, and I want to show the redirect.php with the same this link.
My question is: How can I make this working when the files doesn't exist?
Upvotes: 2
Views: 47
Reputation: 8214
Use the ?
regex symbol.
RewriteRule client/(_([&/]*))? redirect.php [L]
Upvotes: 1