致@All,没人来回答这个问题吗?
我已经通过以下 SO 问题Zend Server Community Edition .htaccess 问题尝试了我的以下问题,但未能成功。这就是为什么在这里发布我的详细信息问题如下:
我有一个非常严重的问题Zend Community Server Edition (ZendServer-CE-php-5.3.9-5.6.0-SP1-Windows_x86)
。
一切正常,但不是URL Rewrtiting
。
我在 Windows 7 上的文件夹httpd.conf
文件中设置了以下内容Apache
我在文件中启用mod_rewrite
了模块,例如httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so
以下是我所有项目的文档根目录
DocumentRoot "D:/projects/"
及其相关<Directory>
设置如
<Directory />
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
#Order deny,allow
#Deny from all
</Directory>
<Directory D:/projects>
Options Indexes +FollowSymLinks
AllowOverride All
#Order deny,allow
#Deny from all
Order allow,deny
Allow from all
</Directory>
我.htaccess
在 httpd.conf 中的设置如下
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
现在,我的test
文件夹路径如下URL Rewriting
。
D:/projects/url
D:/projects/url/.htaccess
.htaccess 文件的内容如下
RewriteEngine on
RewriteRule ^news news.php
RewriteRule ^news/id/(.*)/article/(.*) news.php?id=$1&article=$2
D:/projects/url/news.php
在 news.php 文件中(当我在 localhost:/url/news.php 之类的地址栏上指定它时,它不起作用并给出以下错误消息
禁止的
您无权访问此服务器上的 /url/news。
news.php 文件中的代码如下
$path = $_SERVER['REQUEST_URI'];
echo $path."<br/>";
//below is for http://localhost:<PORT>/url/news/id/62/article/abc
if(isset($_GET['id']) && isset($_GET['article']))
{
echo $_GET['id']."<br/>";
echo $_GET['article'];
}
任何指导将不胜感激。
致@All,没人来回答这个问题吗?