0

这是我的第一个问题。我在根目录上有一个 wp 站点,它是自己的.htaccess文件。

RewriteEngine off
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/katambi/public_html/php.ini
<Files php.ini>
order allow,deny
deny from all
</Files>
</IfModule>

# 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

在另一个目录上,我有 SocialEngine 网站。它也有.htaccess文件。

<IfModule mod_rewrite.c>
  Options +FollowSymLinks
  RewriteEngine On

  # Get rid of index.php
  RewriteCond %{REQUEST_URI} /index\.php
  RewriteRule (.*) index.php?rewrite=2 [L,QSA]

  # Rewrite all directory-looking urls
  RewriteCond %{REQUEST_URI} /$
  RewriteRule (.*) index.php?rewrite=1 [L,QSA]

  # Try to route missing files
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} public\/ [OR]
  RewriteCond %{REQUEST_FILENAME} \.(jpg|gif|png|ico|flv|htm|html|php|css|js)$
  RewriteRule . - [L]

  # If the file doesn't exist, rewrite to index
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?rewrite=1 [L,QSA]

</IfModule> 

问题:当我进入包和插件页面时,它显示 404 错误。=(

当我删除代码之间

# BEGIN WordPress

# END WordPress

wp-site down,但社交网络运行正常。

感谢您的回答。

4

1 回答 1

1

# BEGIN WordPress和之间的代码# END WordPress将所有请求重定向到根目录的 index.php。您需要确保对 SocialEngine 目录的请求没有被重定向。所以你可以试试这个解决方案- .htaccess & Wordpress: Exclude folder from RewriteRule

于 2013-01-16T10:17:27.890 回答