What is needed to have redirected URL appear in browser address bar instead of original site URL?

本小妞迷上赌 提交于 2019-12-12 05:31:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!