Relative Moodle Links

Relative Moodle Links

Howard Miller - මගින්
Number of replies: 1
Core developers ගේ පින්තුරය Documentation writers ගේ පින්තුරය Particularly helpful Moodlers ගේ පින්තුරය Peer reviewers ගේ පින්තුරය Plugin developers ගේ පින්තුරය
When putting in a link from one part of a moodle site to another, it is easy enough to do by copying the address line of the target page.

However, this address will be absolute, which is fine until you have to move the site to another server or similar.

Is there anyway to construct these links such that they are all relative to the site?
ශ්‍රේණිගත කිරීම්වල සාමාන්යය: -
In reply to Howard Miller

Re: Relative Moodle Links

Martin Dougiamas - මගින්
Core developers ගේ පින්තුරය Documentation writers ගේ පින්තුරය Moodle HQ ගේ පින්තුරය Particularly helpful Moodlers ගේ පින්තුරය Plugin developers ගේ පින්තුරය Testers ගේ පින්තුරය
Just use everything after the DNS name:

  <a href="/mod/forum/discuss.php?d=1131">link</a>

You just have to be sure that

http://oldsite.com/    -->  http://newsite.com/

or

http://oldsite.com/moodle    -->  http://newsite.com/moodle

but not:

http://oldsite.com/moodle    -->  http://newsite.com/mycourses
ශ්‍රේණිගත කිරීම්වල සාමාන්යය: -