enl*_*loz 0 php apache .htaccess mod-rewrite http-status-code-404
例如:
Dir结构
localhost/
|- test/
|- index.php
|- .htaccess
Run Code Online (Sandbox Code Playgroud)
index.php:
<?php
if(isset($_GET['cmd'])){
echo "cmd is ok";
}
?>
Run Code Online (Sandbox Code Playgroud)
的.htaccess
RewriteEngine On
RewriteRule ^([^/]*)/$ /test/index.php?cmd=$1 [L]
Run Code Online (Sandbox Code Playgroud)
如果用户设置: http://localhost/test/index.php?cmd=a
输出将是: cmd is ok
那没问题!
如果用户设置,我想得到相同的结果http://localhost/test/a
应该如何设置.htaccess/mod_rewrite?
有了代码,我只得到404.
| 归档时间: |
|
| 查看次数: |
337 次 |
| 最近记录: |