Reputation: 37
I am looking to do a rewrite for all requests after a directory in a url, but cant for the life of me figure out how to do it.
Essentially looking for:
url.com/directory/anything/after/the/directory/
So if any requests com to url.com/directory/ regardless of what comes after it is redirected back to the index that was before the directory (ie. url.com)
I tried with a regex pattern: /forex/.?(.*)
But i'm really not getting anywhere.
Can anybody kick me in the right direction. I was essentially going for:
RewriteRule \/forex\/.?(.*) inxe.php
This didnt work though.
Appreciate all responses, thanks!
Upvotes: 1
Views: 33
Reputation: 41219
Try :
RewriteRule ^/?dir/((?!index).+)$ /index.php [NC,L,QSA]
This will redirect
to
Upvotes: 0