我目前安装了 SocialEngine,所有 url 都由 .htaccess 文件处理,该文件重定向到socialengine.php文件并处理漂亮的 URL 等。
我想停止example.com/
重定向到脚本,因为我想在那里放置一个不同的索引页面。所以我希望我的 .htaccess 文件处理它无法通过socialengine.php脚本找到的所有其他文件,但保持根文件进入index.php。
因此,如果是.com/
,则转到index.php,如果是其他任何内容,则通过socialengine.php处理。
下面是我需要更改的 .htaccess 文件。
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# Get rid of index.php
RewriteCond %{REQUEST_URI} /socialengine\.php
RewriteRule (.*) socialengine.php?rewrite=2 [L,QSA]
# Rewrite all directory-looking urls
RewriteCond %{REQUEST_URI} /$
RewriteRule (.*) socialengine.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 ^(.*)$ socialengine.php?rewrite=1 [L,QSA]
</IfModule>
提前感谢您的任何回复。