Keep website url constant when navigating to anoth

2019-07-18 02:00发布

I want my site address bar not to change its address when I go to subpages, it should show my index.html, even though I enter tosub pages.

Like if I open www.xyz.com and I navigate to any page it should still show www.xyz.com.

I heard this can be done with .htaccess is it possible?

1条回答
闹够了就滚
2楼-- · 2019-07-18 02:40

You really should think about why you want it, because this way of working has a couple of drawbacks with it:

  • Users can't see they are on a different page
  • Users can't bookmark your pages for fast access
  • Users can't share links to eachother
  • Search Engines may have trouble spidering your side

But basically, there are two main ways to do this:

  1. Use frames. Put the page into a frame, and have all the links stay in this frame.
  2. Use Javascript. Have each page "load" into the current page, using AJAX.
查看更多
登录 后发表回答