Maison  >  Article  >  développement back-end  >  url重写不太清楚,总是出错

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

WBOY
WBOYoriginal
2016-06-13 12:38:22783parcourir

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
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn