请用php重写网址 [英] Please URL Rewrite in php

查看:63
本文介绍了请用php重写网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问我如何重写

有人可以重写此网址吗?

Could anybody please rewrite this url?

http://localhost/display_news_cat.php?news_cat_id = 14& p = 2

http://localhost/display_news_cat/14/2

谢谢

推荐答案

Afaik,通常使用Apache .htaccess文件重写规则来完成. 你是不是这样呢?

Afaik, this is normally accomplished with Apache .htaccess file rewrite rules. Is you case this would look something like:

RewriteEngine on
RewriteRule ^display_news_cat/([0-9]+)/([0-9]+)$ display_news_cat.php?news_cat_id=$1&p=$2

如果这不起作用,请尝试检查您的访问日志以查看发生了什么情况.

If this doesn't work, try checking your access logs to see what's happening.

这篇关于请用php重写网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆