admin管理员组文章数量:1332395
So here is a requirement:
- Client wants a page template where there is two level menu on left side of the page.
- That menu can link to any page, post, category or a section within same page.
- The menu which links to a section within same page should be slash linked and not # linked for the purpose of SEO.
And this is how we have implemented it:
- Based on one requirement I have developed a custom page template with sidebar on left.
- Using WordPress menu I registered multiple menus with menu items as per the requirement.
- I developed a custom widget which provides an option to select a menu to be assigned to that page. So far all good....
And here comes the question:
- How do I link the section within same page with
/
and not#
? - For example if the page is
/
and there is a section within page content say "Get Passes" and also a menu corresponding to it on left. Now what client wants is that the menu shall not be linked likebut rather
/
- Needless to say that it should just scroll down to that particular section without reloading the page.
So here is a requirement:
- Client wants a page template where there is two level menu on left side of the page.
- That menu can link to any page, post, category or a section within same page.
- The menu which links to a section within same page should be slash linked and not # linked for the purpose of SEO.
And this is how we have implemented it:
- Based on one requirement I have developed a custom page template with sidebar on left.
- Using WordPress menu I registered multiple menus with menu items as per the requirement.
- I developed a custom widget which provides an option to select a menu to be assigned to that page. So far all good....
And here comes the question:
- How do I link the section within same page with
/
and not#
? - For example if the page is
http://example/event-page/
and there is a section within page content say "Get Passes" and also a menu corresponding to it on left. Now what client wants is that the menu shall not be linked likehttp://example/event-page/#get-passes
but ratherhttp://example/event-page/get-passes/
- Needless to say that it should just scroll down to that particular section without reloading the page.
- 4 lol, is there an actual justification (ROI) for making all the effort that will be required to make it work? I mean actual article by google or some other authority? (need to tag this question under "crazy clients") – Mark Kaplun Commented Jan 13, 2017 at 14:22
- Agree with Mark. You are going to end up in a combination of JS and .htaccess rewrites to do something that really doesn't need to be done and will be a maintenance nightmare. Page SEO is more than just URLs... – C C Commented Jan 13, 2017 at 14:24
- @MarkKaplun - Yeah its kind of funny and challenging. I do agree that it may not be worth putting so much of efforts. I searched if there is any article from google that # links are bad for SEO and you must go for / links or something like that. But did not find something like that, so thought to ask here :) – Prasad Nevase Commented Jan 13, 2017 at 14:33
- 1 there is just too many details to take care of - JS, duplicate content, browser history maybe, page caching if you use.... too many thing that might go wrong. Realy needs some huge proven benefit to even start coding such thing – Mark Kaplun Commented Jan 13, 2017 at 14:47
- This works? /index.php#your-anchor – Nate Commented Apr 19, 2017 at 14:41
1 Answer
Reset to default 1You can use history.pushState
to change the browser URL without reloading a page, and jQuery's scrollTop
method to scroll to the top of a specific element (and there are VanillaJS equivalents too). This will mimic the functionality of #
anchors.
However, like what Mark said, what your client wants is really weird. It is hard to maintain and keep working, and it might even hurt your client. Here's a case study that you might want to show him/her.
本文标签: seoLink section within page with slash () and not hash () without reloading the page
版权声明:本文标题:seo - Link section within page with slash () and not hash (#) without reloading the page 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742282444a2446342.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论