使用htaccess的文件重写URL? [英] rewrite url using htaccess file?

查看:152
本文介绍了使用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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆