我已经在我的htaccess的文件
I have this in my htaccess file
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
这将让人们访问服务器/ login.php中
刚才服务器/登录
但我怎样才能使就这样,如果服务器/ login.php中
输入到地址栏会重定向到服务器/登录
。
Which will allow people to access server/login.php
as just server/login
but how can I make it so that if server/login.php
is entered into the address bar it will redirect to server/login
.
我的网站获得不同的点击率,而不是因为这个问题只是一个网址,感谢您的精力和时间。
My site is getting different hits rather than just for one url because of this issue, thanks for your effort and time.
更改您的基本路径的RewriteBase /路径/
Change your base path RewriteBase /path/
RewriteEngine on
RewriteBase /path/
RewriteCond %{THE_REQUEST} .php
RewriteRule ^(.*).php$ $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php