网站使用.htaccess文件更改相应的链接链接、文件、网站、htaccess

2023-09-02 01:06:29 作者:随风

可以编辑.htaccess文件。的网站在首页的所有链接基址将改变呢?

can editing .htaccess file. Base address of site for all link on home page will changed?

场景:我osclass托管在openshift云网址 http://myappdomain.rhcloud.com 在服务器端添加别名之后我使用www.mydomain.com与转发屏蔽feature.Everyting被罚款家庭page.But poblem时就从www.mydomain website.Browser URL字段变化的任何链接的用户点击.COM到 http://myappdomain.rhcloud.com/link 代替www.mydoamin.com/link但是如果用户手动键入www.mydomain.com/link它的工作原理,并保持相同的不改变来的http:// myappdomain在浏览器的URL .rhcloud.com /链接。将鼠标悬停在链接也显示 http://myappdomain.rhcloud.com/link 不www.mydomain.com/链接 我甚至尝试编辑config.php文件

scenario:My osclass hosted at openshift cloud with url http://myappdomain.rhcloud.com After adding alias at server side i am using www.mydomain.com with forwarding masking feature.Everyting is fine for home page.But poblem is when user click on any link on website.Browser URL field change from www.mydomain.com to http://myappdomain.rhcloud.com/link instead of www.mydoamin.com/link.but if user manually type www.mydomain.com/link it works and it remain same not changing to http://myappdomain.rhcloud.com/link in browser URL. Hover over links also show http://myappdomain.rhcloud.com/link not www.mydomain.com/link i even try to edit config.php file

define('WEB_PATH', 'http://www.mydomain.com/');

但它不能正常工作。我的观点是可以这样acheive与编辑.htaccess文件以最小的影响或有一些其他的方式。之前有自定义域任何人试图openshift的osclass?字preSS和osclass在architecture.Have字preSS用户在openshift面对这样的问题很相似?

but it is not working. my point is can this acheive with editing .htaccess file with minimal effect or there some other way. Have anyone try openshift for osclass before with custom domain? wordpress and osclass are quite similar in architecture.Have wordpress users on openshift face such problem?

推荐答案

请注意,只有的.htaccess改变服务器处理访问者的请求的方式。它不会改变你的网站内容。因此,你不能用的.htaccess设置更改悬停的结果。

Please note that .htaccess only changes the way server handles visitor's request. It does not change the contents in your web site. Therefore, you can never change your "hover result" with .htaccess settings.

我认为这取决于链接是如何在你的网站产生的:

I think that depends on how the links are generated in your website:

如果该链接以及HTML存储在数据库中,你需要与数据库查询更改。如果你使用MySQL,请了解您的数据库结构和形成正确更换查询。

如果有载生成的链接,请确保您刷新所有的高速缓存。缓存可能不知道,你的 WEB_PATH 发生了变化。

If the links are generated on-load, please make sure you flush all the caches. Cache may not know that your WEB_PATH has changed.

 
精彩推荐
图片推荐