htaccess 将子目录重定向到另一个子目录
htaccess redirect subdirectory to another subdirectory
由于 Seo 问题,我必须将我的 URL 从 /blog.html/* 重定向到 /blog/*。
正在寻找
的 .htaccess 规则
RewriteRule ^blog.html/?(.*)$ /blog/ [R=301,NC,L]
这个已经试过了
我试过了
RewriteEngine on
RewriteRule ^/?folderA/(.*)$ /folderB/ [R,L]
但这只会将 domain/blog.html 重定向到 domain/blog 但不会将 domain/blog.html/anyblog 重定向到 domain/blog/anyblog
我的网站托管在 cpanel 上,博客是通过 WordPress 添加的,因此两个网站的 .httaccess 文件不同。
RewriteEngine On
RewriteBase /
RedirectMatch 301 ^/blog.html/(.*)$ http://abcd.com/blog/
这应该有效。
由于 Seo 问题,我必须将我的 URL 从 /blog.html/* 重定向到 /blog/*。 正在寻找
的 .htaccess 规则RewriteRule ^blog.html/?(.*)$ /blog/ [R=301,NC,L]
这个已经试过了
我试过了
RewriteEngine on
RewriteRule ^/?folderA/(.*)$ /folderB/ [R,L]
但这只会将 domain/blog.html 重定向到 domain/blog 但不会将 domain/blog.html/anyblog 重定向到 domain/blog/anyblog
我的网站托管在 cpanel 上,博客是通过 WordPress 添加的,因此两个网站的 .httaccess 文件不同。
RewriteEngine On
RewriteBase /
RedirectMatch 301 ^/blog.html/(.*)$ http://abcd.com/blog/
这应该有效。