【发布时间】:2014-12-04 01:47:37
【问题描述】:
在 public_html 文件夹中,有许多其他域的文件夹和一个 .htaccess 文件。我需要编辑特定域的 .htaccess 文件,而不影响其他域。
这是 .htaccess 文件的最后几个条目的样子
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
我想在 RewriteBase 之后添加这段代码,但我不想搞砸其他域。
RewriteRule ^page/(.*) ads/page/$1 [R=301,L]
RewriteRule ^page/(.*)/ ads/page/$1/ [R=301,L]
我该如何解决这个问题?
【问题讨论】:
标签: mod-rewrite