使用 htaccess 文件重写 url?
我想将此 url 重写
http://localhost/vector-svn/demo.php
为
http://localhost/vector-svn/demo
我的 .htaccess 文件代码,
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.$ $1.php [nc]
如有任何帮助,将不胜感激?
I want to rewrite this url
http://localhost/vector-svn/demo.php
rewrite to
http://localhost/vector-svn/demo
my .htaccess file code
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.$ $1.php [nc]
any kind help would be appreciated ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
回答我自己的问题!!
这适用于 url 重写!
Answer to my own question !!
This works for url rewriting !!
你可以这样做:
编辑:我看到你的重写规则是完全相同的。你有什么问题吗?
You could do this:
Edit: I see your rewrite rule is exactly the same. What problem do you have?
听起来 mod_rewrite 根本没有安装。检查 apache 文档,链接。
抱歉,简短的回答...此链接也可能对您有所帮助,可能是一些事情,并且如上所述,重写看起来不错,所以请尝试看看以下任何内容是否有效。
http://www.wallpaperama.com/forums/how-to-fix-mod-rewrite-500-internal-server-error-on-htaccess-file-apache-t718.html
Sounds like mod_rewrite is not installed at all. Check apache documentation, link.
Sorry, brief answer... this link might also help you out, could be a few things and as mentioned the rewrite looks fine, so try and see if any of the following work.
http://www.wallpaperama.com/forums/how-to-fix-mod-rewrite-500-internal-server-error-on-htaccess-file-apache-t718.html