Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7596247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:52:26+00:00 2026-05-30T21:52:26+00:00

My navigation menu is generated in a single PHP file and included in each

  • 0

My navigation menu is generated in a single PHP file and included in each page. Some of the links are simply anchors on the homepage. When the user is on another page, these links should take them to the home page and then to the appropriate anchor. However, if the user is already on the home page, it would be nice if the page didn’t have to reload.

This will reload no matter what:

<a href="/home#anchor">link</a>

This won’t reload if you’re already on the home page, but doesn’t work from other pages:

<a href="#anchor">link</a>

Is there a way to achieve the best of both worlds without using JavaScript?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:52:27+00:00Added an answer on May 30, 2026 at 9:52 pm

    Okay I figured this out. What I had was a folder called home. So if you navigated to http://example.com/home it would take you to index.php in the home folder. I also had an internal anchor on index.php. If the navigation link had /home#anchor as the HREF, then the page would reload when you clicked on it. What I discovered is that if the link has /home/#anchor (with an extra forward slash), then the page doesn’t reload when the link is clicked. Hope this helps someone else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an application where we have a single level navigation menu with some
I'm trying to implement a simple horizontal navigation menu that just shows a single
I'm creating a navigation menu with words with different colors ( href links). I
I have a menu generated in a Umbraco macro: <xsl:for-each select=$currentPage/* [@isDoc and string(umbracoNaviHide)
I have navigation menu that once the user click then change and fade the
I have navigation menu using images, I want that if the user click a
I have a navigation menu generated by Wordpress, meaning I have pretty much no
I'm trying to generate environment-independent links in a navigation menu with Symfony routing system.
Hello I have the following code to generate my navigation/page menu along with applying
I have a navigation menu that has links with CSS3 transitions with a speed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.