question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pages duplicate when accessing with /index.html

See original GitHub issue

Versions:

“preact-cli”: “^3.4.1”, (standard template) “preact”: “^10.11.3”, “preact-render-to-string”: “^5.1.4”, “preact-router”: “^4.1.0”

I’m not sure if this is a bug or wheter it’s by design. It seems an issue for use cases.

I set up the routing like this:

<Header />
  <Router>
    <Home path="/" />
    <Component2 path="/component2" />
    <Component3 path="/component3 />
  </Router />
<Footer />

The issue: When pages are accessed with index.html, i.e. mysite.com/index.html, the site is duplicated as soon as one navigates to a new route. Inspecting the DOM shows that both elements are present. The previous page is attached after the new one.

This can be an issue since some Projects used /index.html as entry point and many backlinks point to /index.html.

I did a rather dirty workaround to hide the duplicate element from the viewer. The issue can be solved that way, but it’s far from a elegant solution.

I’m aware that the issue could also be solved by re-directing in the backend. But that’s not elegent either.

How you guys deal with that issue?

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rschristiancommented, Dec 16, 2022

No worries, and if you are able to reproduce I’d be happy to reopen and investigate.

Sorry that’s happening for you though, not really sure what that could be. Browser cache? Old service worker perhaps?

0reactions
wenzfcommented, Dec 16, 2022

I can’t reproduce the behaviour as well when trying to build it with a new set up. Probably there is something corrupted in my project. I think this issue can be closed. Sorry for false alarm.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix duplicate content for homepage and index.html - Moz
I currently have a 301 setup for my http to https page and don't have any rel=canonical added to the site/page. What is...
Read more >
seo - How to make sure Google doesn't think index.html and ...
A better methodology for duplicate pages would simply be to mark your index.html page as cononical with your home page.
Read more >
How to Avoid Duplicate Content and Indexing Issues on Your ...
Posting duplicate content could cause a drop in organic traffic to your website. Here are 12 possible solutions to improve your rankings.
Read more >
Home page URL, /index.html and duplicate - Seller Community
Solved: Hi ! My home page seems to have 2 duplicates: http://www.omanselfdrivetours.com http://www.omanselfdrivetours.com/index.html Anyway, both URL.
Read more >
Duplicate Content - How to Solve "Duplicate" Issues - SEOquake
Duplicate home page on index.html/htm or index.php. Duplicate content caused by inbound links. Navigation, where sorting, attributes, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found