Redirect every incoming request to specific path preserving file and query?
As I’m not strong with apache could someone point me in right direction with this?
I currently have urls like this
What I’m looking to do is to rewrite my code so i it don’t use
/public/ part anymore, but after that i still need to support all crawlers and old urls people are linking to.
So how would i do 301 redirect preserving everything that comes after
(Example) Need to redirect something like this
with 301 redirect.
Redirect 301 /public/my_file.php /my_file.php
The query string gets passed along by default.
To redirect everything in the public folder, use this:
RedirectMatch 301 /public/(.*) /$1
Answered By – Jon Lin