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

使用htaccess进行mod-write动态链接不起作用

I want that when I enter to

http://localhost/web/post/136

It will go to

http://localhost/web/file/home/page.php?post=136

This is what I did:

RewriteEngine on
RewriteRule ^/post/([0-9]+)$ file/home/page.php?post=$1 [last]

What I need to change?

As per your comment , To fix the js ,css and other relative links on rewritten urls ,you can add the following base tag to the head of your document :

<base href="/">

近期文章

  • 密码检索系统不发送电子邮件codeigniter
  • 优化与MySQL查询的慢速匹配
  • WordPress:需要更改RSS Feed中的帖子永久链接URL
  • 在phpMyAdmin中自动化MySQL
  • 登录失败时请勿刷新
  • 从Android到PHP的POST LineString
  • Laravel 5.2删除Job中的队列
  • Laravel将json传递给vue.js
  • Wordpress时间线显示帖子每月
  • Codeigniter - PHP CSV文件上传
  • 使用rest api创建post wordpress.com
  • php curl和CURLOPT_FOLLOWLOCATION行为
  • Analytics查询将行返回为null
  • 从自动保存脚本无法正确保存表单
  • 如何使用Angular控制器将变量传递给另一个页面?
  • htaccess URL使用多个GET变量和相对URL重写
  • 如何使用PHP在Word中创建与不同用户的下载链接
  • Zizaco / Entrust中间件HttpException
  • 将PHP MySQL查询响应编码为JSON问题
  • 用于查找图像ID和类型的PHPUnit测试用例

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华