我的网页以前是blog.example,但现在是example.我必须删除/blog目录(该网站位于blog.example所在的网站),因为我在URL example/blog上有一个Wordpress页面,因此将其搞砸了.
My webpage used to be blog.example, but it is now example. I had to delete the /blog directory (where the website hosted blog.example), because I have a Wordpress page at the URL example/blog and that screws it up.
我尝试过:
RewriteEngine on RewriteCond %{HTTP_HOST} ^blog\.example\ RewriteRule ^(.*)$ www\.example\/$1 [L]以及:
RewriteEngine On RewriteCond %{HTTP_HOST} ^(www\.)?blog\.example\$ [NC] RewriteRule ^ www.example/%{REQUEST_URI} [NE,R=301,L]并且:
RewriteEngine on RewriteCond %{HTTP_HOST} ^blog\.example\$ [NC] RewriteRule ^(.*)$ example/$1 [R=301,L]但是,这些子域在子域中没有任何区别. 我该怎么做才能将blog.website/URLS重定向到website/URLS? (无需创建example/blog,因为它会破坏Wordpress的网页网站/blog)
But none of these make any difference in the subdomain. What can I do to redirect blog.website/URLS to website/URLS? (without creating example/blog because it will mess up Wordpress's webpage website/blog)
推荐答案我知道了!我必须:
将此重定向代码添加到/blog-redirect下的.htacces文件中:
Add this redirect code to the .htacces file under /blog-redirect: RewriteEngine On RedirectMatch 301 ^/(.*)$ example/$1
更多推荐
使用域目录中的.htaccess将子域重定向到域
发布评论