2017-07-07 42 views
0

所以我的問題是,我有一個子目錄此運行,有幾個問題...的.htaccess 301重定向和刪除page.php文件

  1. 當我添加了301重定向,我收到了500錯誤
  2. 我不能讓 「頁」 從URL刪除(http://174.136.15.245/~clubz/test/page/about-club-z-tutoring-test

這裏是我的代碼:

<IfModule mod_rewrite.c> 
    Options +FollowSymLinks 
    RewriteEngine On 
    RewriteCond %{HTTPS} !=on 
    # RewriteRule (.*) http://174.136.15.245/~clubztutors/test/ [R,L] 

    RewriteBase /~clubz/test/ 

    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    # RewriteRule ^(.*)$ page.php?/$1 [R=301, L] 
    # RewriteRule ^page.php?p=$1 page/([^/.]+)/?$ [R=301, L] 
    # This works but add "page" directory 
    RewriteRule ^page/([^/.]+)/?$ page.php?p=$1 [L] 
</IfModule> 

我在這裏查看了一些其他解決方案,但仍然無法完全按照我需要的方式運行。任何洞察力將不勝感激。

回答

0

累積獎金!那麼,至少從頁面中刪除網頁:

RewriteRule ^([^/.]+)/?$ page.php?p=$1 [L] 

重定向仍然無法正常工作,但它會很高興有。現在我會跑這個。