重定向的.php没有.PHP(Redirect .php to no .php)

   IT问题网   2018-07-11 00:00:00

问 题

我已经在我的htaccess的文件

rewriteengine叙述上
的rewritecond%{} request_filename!-d
的rewritecond%{request_filename} \ php -f
重写规则^(。*)$ $ 1.php
 

这将让人们访问服务器/ login.php中刚才服务器/登录但我怎样才能使就这样,如果服务器/ login.php中输入到地址栏会重定向到服务器/登录。

我的网站获得不同的点击率,而不是因为这个问题只是一个网址,感谢您的精力和时间。

解决方案

更改您的基本路径的rewritebase /路径/

rewriteengine叙述上
的rewritebase /路径/

的rewritecond%{the_request} \ .php
重写规则^(。*)\。php的$ $ 1 [r = 301,l]

的rewritecond%{} request_filename!-d
的rewritecond%{request_filename} \ php -f
重写规则^(。*)$ $ 1.php
 

标签:定向没有



分享:

  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


热门推荐

重写不工作?(Rewrite doesn't work)

problem i am trying to write a rewritrule in ...

重写规则工作不正常?(RewriteRule not working as expected)

problem i am trying to implement a front controller. so i ...

文件夹内隐藏网/ app.php只需用的.htaccess Symfony2的项目(Symfony2 project inside folder hide web/app.php just with .htaccess)

problem i have help-desk project made using symfony2 and ...

我用的手机网站和放大器;创建子域,但在手机没有工作,这是我的.htaccess文件(i used mobile website & create subdomain but not worked in mobile this is my .htaccess file)

problem this is my auto generated htaccess file rewrite ...

HTTPS非WWW到https WWW(https non www to https www)

problem i rewrite all non-www requests to www ...

htaccess的内部服务器错误(internal server error for htaccess)

problem the server encountered an internal er ...

的.htaccess 301重定向传递沿着旧的URL到新的URL(.htaccess 301 redirect passing along old url to new url)

problem i'm redirect some static html files/urls to some ...

Zend框架2重写URL(Zend Framework 2 Rewrite URL)

problem i have a zend framework 2 app and i wish to use . ...

允许斜杠URL的.htaccess(allow slash in url .htaccess)

problem i have a webpage set up where the user can naviga ...

删除的index.php codeigniter(remove index.php codeigniter)

problem i really can't find a way to make my ...

RedirectMatch不工作在htaccess的(RedirectMatch not working in htaccess)

problem iam trying to to redirect my page from from htt ...

PHP:URL重写(PHP : url rewriting)

problem i want to know how to page url without .php exten ...

htaccess的不工作的IP /用户名(.htaccess not working on ip/~username)

problem here is my case. i'm trying to use .htaccess for ...

使用的.htaccess URL重定向(Using .Htaccess url redirection)

problem i want to rewrite my url but i cant d ...

移动重定向使用htaccess的桌面版本(Mobile Redirect to desktop version using htaccess)

problem i have a website called www.example. ...

致命错误:67108864在opencart允许的内存大小(Fatal error: Allowed Memory size of 67108864 in opencart)

problem i'm using opencart. in my admin page ...

codeIgniter删除的index.php不工作(CodeIgniter removing index.php not working)

problem i'm using ubuntu 13 with the following setup for ...

AngularJS路由问题与Apache(AngularJS routing issue with apache)

problem i am using yeoman package manager to ...

如何重定向到动态内容的.htaccess(How to redirect to dynamic content with .htaccess)

problem now that i know how to write seo friendly links, ...

PHP $ _GET变量是空的,由于URL重写(PHP $_GET variable is empty due to URL rewriting)

problem i have rewritten a url with .htaccess so it looks ...