【问题标题】:How can I access sub domain file from the URL?如何从 URL 访问子域文件?
【发布时间】:2014-05-13 04:14:30
【问题描述】:

我在http://zend.patidarweb.com/上安装了wordpress

我在http://zend.patidarweb.com/sitemap_index.xml 上有一个站点地图

我想从http://patidarweb.com/zend/sitemap_index.xml访问

我必须在 .htaccess 中添加什么才能解决我的问题?

提前感谢所有用户。

【问题讨论】:

    标签: php wordpress .htaccess subdomain sitemap


    【解决方案1】:

    您可以在 .htacces 文件中使用简单的重定向,例如

    RewriteCond %{REQUEST_URI} ^/zend/sitemap_index.xml [NC]
    RewriteRule ^(.*)$ http://zend.patidarweb.com/sitemap_index.xml [R=301,L]
    

    或者您需要使用代理,以避免重定向和仅获取内容

    【讨论】:

    • 对不起!有一个错误。已更新。
    • 更新后的代码运气不好...我还尝试从面板重定向一个 url 并尝试您的代码,但运气不好.....
    • 您是否启用了 mod_rewrite。!这段代码应该可以工作。我已经测试过了。不要忘记添加RewriteEngine On,并尝试将此代码移至页面顶部。
    • 是的,我已经开启了重写引擎,并从 wordpress .htaccess 中获得了参考,并做了一些额外的 exp。但还没有运气!
    猜你喜欢
    • 1970-01-01
    • 2017-01-31
    • 1970-01-01
    • 1970-01-01
    • 2014-05-20
    • 2013-08-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多