RuZ*_*uZk 5 php apache .htaccess mod-rewrite
我有文件结构
索引.php .htaccess 新闻/index.php 新闻/.htaccess
首先.htaccess:
重写引擎开启
重写基数 /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/news/
重写规则。/index.php [L]
第二个(新闻/.htaccess)
重写引擎开启
重写规则。/index.php
请求http://test.t/news/news/61处理第一个 index.php 但我需要做第二个
我为第一个 .htaccess 尝试了更多选项,但没有成功
检查您的 Apache 配置文件 (httpd.conf) 并确保您的站点使用的目录包含 AllowOverride 选项。
例子:
<Directory "/Applications/MAMP/htdocs">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4046 次 |
| 最近记录: |