我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

php.ini为home / xyz写回家/ c?q = xyz

How to write php.ini such that

home/xyz/

means

home/c/index.php?q=xyz

Without creating xyz directory.

Try this

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^home/(.*)/?$ /home/c/index.php?q=$1 [L]

This should redirect all non existing files/directories in home/

EDIT: removing trailing slash

近期文章

  • 为什么javascript slidetoggle功能不能保持打开状态?
  • 试图在PHP中使用字符串替换功能而不起作用
  • CakePHP - 使用DISTINCT时,分页总计数与实际计数不同
  • opencart 2.0 confirm.php getZone注意:未定义索引:名称
  • 如何根据用户是否登录显示不同的选项?
  • 启动memcached:项目最大大小不能小于1024字节
  • PHP代码修改仅检索要添加到PDF的第一个图像
  • 为什么这个php脚本导致“NetworkError:500 Internal Server Error”?
  • 图片标签不接受src
  • Json按照首字母分组
  • Ajax失败,状态为0
  • 将csv文件处理为UTF-8
  • 当flush()主键未插入时
  • 如何使用文件名中的重音链接到PHP平面文件中的图像
  • 如何在php中显示接受朋友邀请的朋友的帖子?
  • 安装mongo php驱动程序centos 6.6
  • 显示十进制值,直到其不为0 [重复]
  • 从时间戳添加和减去时间
  • Github用中文保存更改
  • 从输入字符串中删除所有重复项

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华