2012-09-07 72 views
2

當我點擊wordpress admin的永久鏈接時,它會自動在根文件夾中創建.htaccess文件,然後wordpress站點停止與瀏覽器錯誤工作服務器錯誤500 I在httpd.conf中進行了以下設置,我的mod_rewrite按照php.ini顯示工作。永久鏈接不能在Windows 7上的xampp/localhost服務器上工作

httpd.conf中設置

<Directory "E:/xampp/cgi-bin"> 
    Options FollowSymLinks 
    AllowOverride All 
    Order allow,deny 
    Allow from all 
</Directory> 

<Directory "E:/xampp/htdocs"> 
    # 
    # Possible values for the Options directive are "None", "All", 
    # or any combination of: 
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews 
    # 
    # Note that "MultiViews" must be named *explicitly* --- "Options All" 
    # doesn't give it to you. 
    # 
    # The Options directive is both complicated and important. Please see 
    # http://httpd.apache.org/docs/2.2/mod/core.html#options 
    # for more information. 
    # 
    Options All 

    # 
    # AllowOverride controls what directives may be placed in .htaccess files. 
    # It can be "All", "None", or any combination of the keywords: 
    # Options FileInfo AuthConfig Limit 
    # 
    AllowOverride All 

    # 
    # Controls who can get stuff from this server. 
    # 
    Order allow,deny 
    Allow from all 

</Directory> 

的.htaccess文件代碼

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /xampp/ozi-tech/ 
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /xampp/ozi-tech/index.php [L] 
</IfModule> 
# END WordPress 
+0

什麼web服務器ü用來運行WordPress – rash111

+0

:因爲它是包含在XAMPP rash111 Apache服務器服務器 – Bilal

+0

你看過apache錯誤日誌嗎? – soju

回答

0

我二叔D奮力解決這個問題,但我發現的主要事情是我的本地服務器,它不支持htaccess URL重寫場景,所以我上傳了相同的代碼在FTP帳戶,並獲得救濟在線。

我不知道我們是否可以在本地服務器允許URL重寫,儘管我已取消註釋xampp服務器中的URL重寫模塊,但仍無法在本地環境中工作。

0

使用的.htaccess

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^([^\.]+)$ $1.php [NC,L] 

上面的代碼將擺脫PHP擴展的,從而給你說的指數,而不是index.php文件。是的,它適用於本地主機,幾乎所有的託管公司都包括它。

2

如果你的項目是位於
E:/ XAMPP/htdocs中/ OZI高科技/
,那麼你需要指定本地主機開始的路徑。

E:/xampp/htdocs/ === localhost ===/

你只需要改變RewriteBase重寫規則在.htaccess:

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /ozi-tech/ 
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /ozi-tech/index.php [L] 
</IfModule> 
# END WordPress 
+0

爲我工作只需添加基礎文件夾之前index.php行,..像謝爾蓋顯示:/ozi-tech/index.php [L] – bonesnatch

相關問題