阿帕奇.httaccess重写 [英] Apache .httaccess rewriting

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

问题描述

所以..这就是我想要获得了这幅。

so .. this is what I want to acheive.

我想改写这个网址 http://example.com?page=something http://example.com/something

i want to rewrite this url http://example.com?page=something to this http://example.com/something

这样我可以$ _GET无论是在URL后 $ _GET [页] ='东西'

such that i can $_GET whatever is after the url $_GET['page']= 'something'

我所读过的表演像HTTP教程://example.com/page /某事 所以我在想,如果有可能没有额外的/

all the tutorials I've read show it like http: //example.com/page /something so i was wondering if it is possible without the extra "/"

//更新

这是我对the.httaccess文件

this is what i have on the.httaccess file

RewriteEngine叙述上 重写规则^(。*)/ $的index.php?网页= $ 1 [L]

RewriteEngine on RewriteRule ^(.*)/?$ index.php?page=$1 [L]

但是当我做了回声($ _ GET ['页']);我得到的index.php

but when i do a echo($_GET['page'] ); i get index.php

推荐答案

它需要接受虽然

RewriteRule ^(.*)/?$ index.php?page=$1 [L]

这篇关于阿帕奇.httaccess重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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