URL重写PHP $ _GET变量 [英] URL rewrite PHP $_GET variable

查看:54
本文介绍了URL重写PHP $ _GET变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我想制作一个.htaccess重写文件进行更改:

Hey, I am looking to make a .htaccess rewrite file to change:

newProject/index.php?start=2

newProject/page/2

我该怎么办?谢谢!

推荐答案

我认为您的问题是倒退的,尤其是在您寻找更简洁的URL时.

I think your question is backwards, especially if you are looking for cleaner URLs.

RewriteEngine On
RewriteRule ^newProject/page/(\d+)$ /newProject/index.php?start=$1

我假设您的用户将单击/newProject/page/2之类的URL,并且newProject/index.php处的PHP脚本将访问$_GET['start']来读取页码.

I assume that your users will click on URLs like /newProject/page/2, and a PHP script at newProject/index.php will access $_GET['start'] to read the page number.

这篇关于URL重写PHP $ _GET变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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