I'm trying to write an .htaccess
rule to redirect to a script, which further redirects somewhere else. Kind of like how URL shorteners work. However, I don't want the address bar to change during the .htaccess
part of the redirect. (It's okay for the script redirect to change the location.)
I'm using mod_rewrite
, currently doing this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteBase /
RewriteRule (.+)$ "?url=$1" [L,R=301]
Is there a flag or another method I can use to achieve what I'm trying to do?
Addenda: The location bar doesn't change in Firefox as the redirects are happening, which is what I want to do. It just changes once to reflect the end point. Safari changes it at every step. Any way to avoid that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…