Home  >  Article  >  Backend Development  >  url重写不太清楚,总是出错

url重写不太清楚,总是出错

WBOY
WBOYOriginal
2016-06-13 12:38:22780browse

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
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn