PHP mobile phone cannot jump to domain name

angryTom
Release: 2023-02-28 11:06:01
Original
2856 people have browsed it

PHP mobile phone cannot jump to domain name

php mobile phone cannot jump to the domain name

Sometimes you encounter the problem that the header Location cannot be redirected on the mobile phone , below we use js instead of header location to implement domain name jump.

header("Location://m.sbmmt.com");
Copy after login

was changed to

header('HTTP/1.1 301 Moved Permanently'); header("Content-type:text/html;charset=utf-8"); echo "";
Copy after login

header() for sending native HTTP headers.

header() must be called before any actual output, whether it is ordinary HTML tags, empty lines, or spaces in file or PHP output. This is a common mistake. When accessing functions in other files through include, require, or other functions, if there are spaces or blank lines before header() is called. The same problem exists with separate PHP/HTML files.

For more PHP related knowledge, please visitPHP Chinese website!

The above is the detailed content of PHP mobile phone cannot jump to domain name. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!