dpqvwgr74759 2014-07-21 19:00
浏览 16
已采纳

浏览时保留公园域名网址

I have a website and I have a parked domain on top of it now. The problem is after the visitors log into the site using eg. example.org... after clicking on any link in the site it takes them back to http://example.com/articles/fitness_training/.

How can I keep the parked domain extension from changing in all the urls.. so that when I'm browsing with example.org all my links stay at example.org and vice versa...

I know htaccess can do this, but can't get the correct htaccess directive to do this.

Any help would be appreciated on this...

  • 写回答

1条回答 默认 最新

  • doushan7997 2014-07-21 19:04
    关注

    htaccess can't do this, it sounds like the links in your content point to example.com, so you need to change your links. You can remove the http://example.com part so that it just says /articles/fitness_training/ and it'll stop going to the other site.

    What htaccess can do for you is to redirect any requests for example.com to example.org:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
    RewriteRule ^(.*)$ http://example.org/$1 [L,R=301]
    

    But that means every time someone loads an image, clicks a link, etc, they're hitting your website twice.

    The only other thing you can do with htaccess is to use something like mod_proxy_html which will filter all outgoing content and you can change links dynamically that way.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数