开发者

How do I Redirect a URL in PHP using .htaccess?

开发者 https://www.devze.com 2023-01-10 00:09 出处:网络
How do I redirect a URL in PHP? If I use .htaccess to redirect, then it\'s asking me for authentication (username & password). I want to redir开发者_如何学JAVAect to a URL without any authenticati

How do I redirect a URL in PHP? If I use .htaccess to redirect, then it's asking me for authentication (username & password). I want to redir开发者_如何学JAVAect to a URL without any authentication. Is it possible in PHP? I don't want to use headers or meta tags or window.location to redirect. Is there any other way is possible?


My guess is that you perhaps copy/pasted some code into your .htaccess file has basic authentication?

You only need one line to do that in .htaccess

Redirect 301 /oldpath http://sitecom/newpath
0

精彩评论

暂无评论...
验证码 换一张
取 消