MyBB Community Forums
Change old domain name everywhere & text size question - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: Change old domain name everywhere & text size question (/thread-119393.html)



Change old domain name everywhere & text size question - thenewguy - 2012-05-23

Hi,
I have two questions:

1.

I recently moved our site from an old domain that we lost (lets call it A.com) and set up the site on our new domain (lets call it B.com).

In the forum there are a lot of links and text to A.com, is there some where of changing all these links and text from "A.com" to "B.com"?


2.

On my new host when I try to enter a lot of text (for example 4 pages) into a new post, it immediately throws up a 403 forbidden error, what can I do about this? Is there some setting in the software that is not allowing me to enter so much text in the body of the thread?

Thanks!


RE: Change old domain name everywhere & text size question - anori - 2012-05-24

(2012-05-23, 10:08 PM)thenewguy Wrote: Hi,
I have two questions:

1.

I recently moved our site from an old domain that we lost (lets call it A.com) and set up the site on our new domain (lets call it B.com).

In the forum there are a lot of links and text to A.com, is there some where of changing all these links and text from "A.com" to "B.com"?

http://stackoverflow.com/questions/4939805/change-all-links-hrefs-urls-with-vanilla-javascript-regex

<script type="text/javascript">
function replace_url(elem, attr) {
    var elems = document.getElementsByTagName(elem);
    for (var i = 0; i < elems.length; i++)
        elems[i][attr] = elems[i][attr].replace('a', 'b');
}

window.onload = function() {
    replace_url('a', 'href');
    replace_url('img', 'src');
    // etc
}
</script> 


Ignore the jquery one. This one does seem to work and do the job. And shouldnt conflict with mybb.

Simply adjust A and B to your old and new url name (only the bit you want to replace so not the http:// or .com bits just what is inbetween that needs to be replaced.


Nevermind chrome is not a fan.. gives you a warning since you are altering the URL of users. I guess the best way would then look for a PHP solution to this problem.