Wordpress permalinks在windows 7上的xampp/localhost服务器中不工作

Wordpress permalinks在windows 7上的xampp/localhost服务器中不工作,wordpress,.htaccess,xampp,permalinks,Wordpress,.htaccess,Xampp,Permalinks,当我从wordpress管理员点击permalinks时,它会自动在根文件夹中创建.htaccess文件,然后wordpress站点停止处理浏览器错误服务器错误500我在httpd.conf中进行了以下设置,并且我的mod_重写正在按照php.ini显示进行 httpd.conf设置 <Directory "E:/xampp/cgi-bin"> Options FollowSymLinks AllowOverride All Order allow,deny

当我从wordpress管理员点击permalinks时,它会自动在根文件夹中创建.htaccess文件,然后wordpress站点停止处理浏览器错误服务器错误500我在httpd.conf中进行了以下设置,并且我的mod_重写正在按照php.ini显示进行

httpd.conf设置

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

选项如下符号链接
允许超越所有
命令允许,拒绝
通融


#
#选项指令的可能值为“无”、“全部”,
#或以下任何组合:
#索引包括以下符号链接符号链接所有者匹配执行CGI多视图
#
#请注意,“多视图”必须显式命名为*--“所有选项”
#不给你。
#
#期权指令既复杂又重要。请看
# http://httpd.apache.org/docs/2.2/mod/core.html#options
#了解更多信息。
#
选项全部
#
#AllowOverride控制可在.htaccess文件中放置的指令。
#它可以是“全部”、“无”或关键字的任意组合:
#选项FileInfo AuthConfig限制
#
允许超越所有
#
#控制谁可以从此服务器获取内容。
#
命令允许,拒绝
通融

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
#开始WordPress
重新启动发动机
RewriteBase/xampp/ozi技术/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/xampp/ozi-tech/index.php[L]
#结束WordPress

我确实很难解决这个问题,但我发现的主要问题是我的本地服务器不支持htaccess URL重写场景,因此我在ftp帐户上上传了相同的代码,并在线获得了缓解

我想知道我们是否可以允许在本地服务器中重写URL,尽管我已经取消了xampp服务器中URL重写模块的注释,但仍然无法在本地环境中工作。

使用.htaccess

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

上面的代码将去掉.php扩展名,因此您可以说是index而不是index.php。是的,它可以在本地主机上运行,几乎所有主机公司都包括它。

如果您的项目位于
E:/xampp/htdocs/ozi-tech/
然后需要指定从本地主机开始的路径

E:/xampp/htdocs/  === localhost === /
您只需在.htaccess中更改RewriteBaseRewriteRule

# 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
#开始WordPress
重新启动发动机
电子基地/臭氧技术/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/ozi-tech/index.php[L]
#结束WordPress

我在使用XAMPP时遇到了这个问题,我的项目位于与XAMPP默认项目目录不同的目录中

我通过添加:
AllowOverride All
httpd.conf中的特定
标记之外

因此,在主
标记本身中,如下所示:

#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other 
# <Directory> blocks below.
#
<Directory />
    AllowOverride all
    Require all denied
</Directory>
#
#拒绝访问服务器的整个文件系统。你必须
#明确允许访问其他目录中的web内容目录
#下面的街区。
#
允许超越所有
要求全部拒绝

如果您有更严格的安全需求,一定要弄清楚如何在特定目录中
AllowOverride
,但是允许覆盖所有目录对我来说是一个很快的解决办法。

你在运行wordpress时使用的web服务器:rash111 apache服务器,因为它包含在xampp服务器中。你看了apache错误日志了吗?你想删除index.php或其他为我设计的东西,只需在index.php行之前添加基本文件夹,。。如Sergey所示:/ozi-tech/index.php[L]
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other 
# <Directory> blocks below.
#
<Directory />
    AllowOverride all
    Require all denied
</Directory>