问题
My htaccess is configured correctly to redirect visitors from apples.com to oranges.com, but what do I need to add so that instead of oranges.com appearing in the browser address bar, the user sees apples.com?
Update: As an alternative how can I have htaccess create a variable (such as apples) that can be picked up by javascript?
rewriteengine on
rewritecond %{HTTP_HOST} ^www.apples.com$ [OR]
rewritecond %{HTTP_HOST} ^apples.com$
rewriterule ^domainchange\/$ "http\:\/\/oranges\.com\/" [R=301,L] #numbers
rewritecond %{HTTPS} off
rewritecond %{HTTP_HOST} ^www.oranges.com$ [OR]
rewritecond %{HTTP_HOST} ^oranges.com$
rewriterule ^$ "https\:\/\/oranges\.com\/" [R=301,L] #numbers
Options -Indexes
来源:https://stackoverflow.com/questions/18947506/what-is-needed-to-have-redirected-url-appear-in-browser-address-bar-instead-of-o