Possible to use Site Root & Document Relative links on the same web page

Posted on 2010-08-31
Last Modified: 2012-06-27
Hello Experts,

I build a large web application last year, using Document relative Links. Now because we are implementing SEO friendly pages in one of the directories, I need to change the links from Document relative to Site Root Relative, in order to implement the SEO friendly pages.

This is taking ages..

The other directories don't need to be changed, however there are some scripts "<!--#include virtual="/scripts/script.asp" -->"

Which are included in all documents (web pages) these still have Document relative links.

My question, is will having both document & site root relative links in any one document have a detrimental effect?

Thank you
Question by:garethtnash
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
LVL 18

Accepted Solution

mgfranz earned 500 total points
ID: 33568448
No, there is no detrimental effect on using either document, site-root or absolute paths in the documents.  Thinking about it, SEO might want to use absolute paths over relative or site root.

Nice reading:

As for doing the path replace, why not just use the Replace feature in your editor?  It probably has a switch that can be set to peruse through the entire web site.  Or you can write your own little RegEx that can do the match based on patterns.
LVL 16

Expert Comment

ID: 33568842
Include paths like <!--#include virtual="/scripts/script.asp" --> have no effect on SEO, and there is not need to change them, if referenced from the root, as above.

Author Comment

ID: 33572047
Sorry guys what I mean is, if I have a web page, with most of the links site root relative like -
<a href="/default.asp ">Home</a>
Will it cause any issues if there are one or two links that are not site root relative, for instance -
<a href="../default2.asp ">Other Link</a>
Thank you
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

LVL 18

Expert Comment

ID: 33572106
You should convert them to absolute paths just to be sure.
LVL 16

Expert Comment

ID: 33572530
I would suggest never doing this ../, <a href="../default2.asp ">Other Link</a> , as it limits scalability and changes.

And for SEO purposes, the full path is better.

You could do something like this:

declare a global variable like session("root") = "", and then use that in building links.<a href="<%=session("root") %>/default2.asp ">Other Link</a>.  That way, if the root changes, like it has for you now, you only need to change the session variable (can set in global.asa, or include file.
LVL 16

Expert Comment

ID: 33572538
Also, download Windows Grep.  This is a great tool for finding and replacing patterns in code, in bulk updates.
LVL 16

Expert Comment

ID: 33769031
LVL 16

Expert Comment

ID: 33807008
Why was the suggestion to split points ignored?

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question