Link to home
Start Free TrialLog in
Avatar of garethtnash
garethtnashFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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

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
ASKER CERTIFIED SOLUTION
Avatar of Mark Franz
Mark Franz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of golfDoctor
golfDoctor

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.
Avatar of garethtnash

ASKER

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
You should convert them to absolute paths just to be sure.
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") = "http://www.mysie.com", 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.
Also, download Windows Grep.  This is a great tool for finding and replacing patterns in code, in bulk updates.  http://www.wingrep.com/
split
Why was the suggestion to split points ignored?