2015-04-17 51 views
3

基本上,我在想,如果我能采取像一个网址:的.htaccess重写 - PHP得到变量伪造文件夹

http://Localhost/Core/?page=signin

,并重写

http://Localhost/Core/signin/

就像一个“假”fo lder连续。

我正在使用CSRF,当我提交表单时,它不喜欢PHP获取url中的变量。我希望如果我使用“假”文件夹,它会改变,然后工作..?也许不是,有什么想法?

+0

类似的问题:[http://stackoverflow.com/questions/812571/how -to-create-friendly-url-in-php](http://stackoverflow.com/questions/812571/how-to-create-friendly-url-in-php) – Egel

回答

4

你可以写的.htaccess规则

RewriteEngine On 
RewriteRule ^Core/([^/]*)$ /Core/?page=$1 [L] 

使用这个你的页面变量可以在你的php文件访问

+0

谢谢!这工作! – James519

+0

不客气。 – Kamran