问题描述
我需要htaccess的子域一些帮助将指向特定文件夹中的单词preSS网站。
I need some help on the htaccess subdomain to be pointed to specific file in a folder for a wordpress site.
目前我有这个在我的.htaccess:
Currently I have this in my .htaccess:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain\.domain\.com$
RewriteCond %{REQUEST_URI} !^/subdomain/
RewriteRule (.*) /subdomain/$1
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$
RewriteRule ^subdomain/(.*)$ http://subdomain.domain.com/$1
当用户输入subdomain.domain.com它将访问domain.com/subdomain夹,当它进入domain.com/subdomain它重定向到subdomain.domain.com。 (这正是我希望发生的)
When the user enters subdomain.domain.com it will access the domain.com/subdomain folder and when it enter domain.com/subdomain it will redirect to subdomain.domain.com. (this is exactly what i want to happen)
但问题是内部的子域的话preSS因为它仍然引荐主域(即图像仍然domain.com/wp-content/uploads~~V而不是subdomain.domain.com/ / ...的wp-content /上传/ ......或至少domain.com/subdomain/wp-content/uploads /...).
Problem is inside the wordpress of the subdomain because it still referrer to the main domain (i.e. the images is still domain.com/wp-content/uploads/... instead of subdomain.domain.com/wp-content/uploads/... or at least domain.com/subdomain/wp-content/uploads/...).
如何让我的子域访问其文件夹中的.htaccess?
How do I make the subdomain access the its folder in .htaccess?
在做这天了。请帮忙。谢谢!
Been doing this for days now. please help. thanks!
推荐答案
打开Word preSS装置的常规设置。
Open your WordPress installation's general settings.
更改网站地址(URL)
到 http://subdomain.domain.com/
。这将解决所有的博客网页生成的链接使用的主要的一个子域名来代替。
Change your Site Address (URL)
to http://subdomain.domain.com/
. This will fix the links generated on all the blog pages to use the sub-domain instead of the main one.
这篇关于在字preSS htaccess的子域文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!