如何更改默认登录页url
我想将我的登录页url从更改为 我试过这个如何更改默认登录页url,url,redirect,url-rewriting,Url,Redirect,Url Rewriting,我想将我的登录页url从更改为 我试过这个 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /example/ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f Redirect 301 / http://example.com/index/id RewriteRule ^index/([^/]*)$ ?i=page.index
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /example/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
Redirect 301 / http://example.com/index/id
RewriteRule ^index/([^/]*)$ ?i=page.index&lang=$1 [L]
</IfModule>
重新启动发动机
重写基础/示例/
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重定向301/http://example.com/index/id
重写规则^index/([^/]*)$?i=page.index&lang=$1[L]
但这不管用
请帮我把这个修好。谢谢。要将URL从
index.php
重写为/index/id
,您需要遵循以下两个步骤:
.htaccess
.htaccess
文件中index.php
,如果你想将index.php
的所有流量重定向到新名字,我建议你不要在中做任何更改。htaccess
文件只需在index.php
文件中检测当前的URL
,然后根据需要重定向它需要
范例
<?
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if(parse_url($actual_link, PHP_URL_PATH) != "/index/id"){
header('Location: /index/id');
}
else{
// do nothing
}
?>
希望这将有助于你,谢谢你嘿发生了什么告诉我,你尝试了我的代码还是没有?
<?
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if(parse_url($actual_link, PHP_URL_PATH) != "/index/id"){
header('Location: /index/id');
}
else{
// do nothing
}
?>