How to easily and effectively determine whether the URL is a homepage or an inner page

Source: Internet
Author: User
How to easily and effectively determine whether the URL is the homepage or the inner page? how to easily and effectively determine whether the URL is the homepage or the inner page
*. Com, www. *. com, or www. *. com/is the homepage.
*. Com/a or www. *. com/a.html or www. *. com/a/is the internal page.
My function is to display different links on the home page and on the internal page. I don't know if this idea is correct. or, let's take a look, if you want to do this (different links are displayed on the homepage and inner pages), what is the idea.
Thank you.


Reply to discussion (solution)

$ Url = 'http: // www.baidu.com/'{$arr=parse_url ($ url); if (str_replace ('/', '', $ arr ['path']) {echo 'not the homepage';} else {echo 'is the homepage ';}

Isn't a friend chain generally a primary domain name stored in the database?

$ Url = 'http: // www.baidu.com/a'?#arr=parse_url ($ url); if ($ arr ['path'] = '/') {echo 'is the homepage ';} else {echo 'not the homepage ';}


Not homepage

What if there are different friend links between pages?
The most fundamental solution is to define a name for each page or a group of pages in the same column. when adding a friend chain in the background, you can specify a name or all pages.

What if there are different friend links between pages?
The most fundamental solution is to define a name for each page or a group of pages in the same column. when adding a friend chain in the background, you can specify a name or all pages.


Thank you very much. Why didn't you think of this? haha, according to your ideas, you have done it. thank you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.