Simple PHP script to detect if the current webpage is the root domain and output different HTML if so.

This project received 6 bids from talented freelancers with an average bid price of $32 USD.

Get free quotes for a project like this
Project Budget
Total Bids
Project Description


I need a PHP script which outputs two different HTML codes. One set of HTML code if the current page is the root domain (i.e. [url removed, login to view]) and a different HTML code if the current webpage is not the root domain (i.e. [url removed, login to view]).

The script needs to be dynamic in that it is transferable to any website/domain so hard coded domain names cannot be used.

I plan on using a PHP include to include the PHP script at the footer of a website template (php).

The idea is that I can display one version of a footer for the homepage and a different version of the footer for the rest of the site. This is mainly so I can add rel="nofollow" to footer links on the rest of the site but not the homepage.

The two different HTML codes simply consist of basic HTML text and href links.

I imagine this script is extremely simple for someone familiar with PHP.

My server runs on Linux with PHP 4.4.4.

I need this script ASAP - today if possible.

Thanks for looking.

Kind regards,


Skills Required

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online