日期:2014-05-17  浏览次数:20430 次

url重写不太明白,总是出错
我用Apache新添加了一个Alias,新生成的网址是http://localhost/gyjw/
输入http://localhost/gyjw/会自动跳转到http://localhost/gyjw/index.php
http://localhost/gyjw/index.php这个是我网站的登陆页面,登陆后跳转到http://localhost/gyjw/main.php
现在我想重写http://localhost/gyjw/index.php和http://localhost/gyjw/main.php这两个地址
分别改成http://localhost/index.php和http://localhost/main/?id=101
我自己本想通过修改.htaccess这个文件来进行重写url,但是RewriteCond和RewriteRule这两个弄了半天也没弄好,总是跳出错误页面500,还是不理解啊!
有没有大神能帮我实现呢?
url .htaccess apache

------解决方案--------------------
引用:
可能是我没说清楚吧.htaccess我已经重写完了,现在我想用include调用一个被重写了地址的文件check.php隐藏其真实地址,他重写后的地址是index.html?fun=000,但是直接include ("index.html?fun=000");会出错说不能打开steam,我去google毫无所获。


include 是直接调用,index.html?fun=000是经过Apache才转向到check.php
如果你include 完整的URL,例如http://localhost/index.html?fun=000  估计就正常了,前提是你的include 能引用URL