本文介绍了使用htaccess的文件重写URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想改写这个网址
http://localhost/vector-svn/demo.php
重写
http://localhost/vector-svn/demo
我的.htaccess文件code
my .htaccess file code
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.$ $1.php [nc]
任何形式的帮助将是AP preciated?
any kind help would be appreciated ?
推荐答案
回答我自己的问题!这适用于URL重写!
Answer to my own question !!This works for url rewriting !!
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
这篇关于使用htaccess的文件重写URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!