2012-09-07 73 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

相关问题