2010-12-04 53 views
1

我有一個當前安裝SocialEngine的所有URL由.htaccess文件重定向通過對socialengine.php文件和處理好的網址等HTACCESS |社交引擎|停止重定向根指數

我想停止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> 

在此先感謝您的任何答覆。

回答