Changing base URL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cheechako
    New Member
    • Dec 2017
    • 11
    • 5.0.x

    Changing base URL

    Developing and testing my vb 5 Connect site on an ISP using a dormant domain that I own. My initial install is at:



    This kept my root public-html folder clean.

    I am ready to deploy, and thought I could point my users to the site by setting a CNAME DNS record to the subfolder where the index.php resides.
    But I found out CNAME records cannot include any directories, just domain names.

    I tried:

    www.myFinalDomain.com CNAME www.myTestDomain.com/subolder/

    but this gave an error "invalid domain" in the DNS utility

    Can I move the installation folder up one level? I try an HTTP redirect, but there are some glitches with redirects.
    Is there a way to actually move the installation up to the server root (public-html) without breaking everything?

    TiA

  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 73981

    #2
    You can move it up a level. What you would want to do is update the URL in the AdminCP under Settings -> Options -> Site Name / URL / Contact details. There are three options at the top that need to be changed. Then move the files up one directory. You should make sure the parent directory is empty of files (sub-folders are fine) before moving vBulletin's files and directories.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment

    • Cheechako
      New Member
      • Dec 2017
      • 11
      • 5.0.x

      #3
      Wayne:

      Many thanks. I tried to drag/drop the entire "/subfolder/" using my FTP utility (Transmit) but got a file write error for the "core" folder. I don't think this is a vBulletin issue. I am trusting that there is nothing in the"core" folder that would prevent it from being copied or relocated. As per your advice, I will visit the cPanel File Manager, and try again.

      Also, I would like to reference the new baseURL as a variable in code. Specifically, I am writing custom Help pages, and some of my links need to refer to the Home Page, Articles, Blogs, Forums etc. In HTML, is there a token I can use that will be replaced with the baseURL of the site when the Help page is rendered, such as...

      <a href="{vb: baseURL}/forum/myBestForum">MyBestForum</a>

      TIA

      Comment

      • Wayne Luke
        vBulletin Technical Support Lead
        • Aug 2000
        • 73981

        #4
        In vBulletin pages, the baseurl is included in the Javascript variable pageData.
        Code:
        		var pageData = {
        			"baseurl": "https://www.vbulletin.com/forum",
        			"baseurl_path": "/forum/",
        			"baseurl_login": "https://www.vbulletin.com/forum",
        			"baseurl_core": "https://www.vbulletin.com/forum/core",
        			"pageid": "15",
        			"pagetemplateid": "15",
        			"channelid": "",
        			"nodeid": "0",
        			"userid": "868",
        			"user_startofweek": "1",
        ...
        You can reference it through this object.
        Translations provided by Google.

        Wayne Luke
        The Rabid Badger - a vBulletin Cloud demonstration site.
        vBulletin 5 API

        Comment

        • Cheechako
          New Member
          • Dec 2017
          • 11
          • 5.0.x

          #5
          Thanks. The folder migration worked perfectly.
          Now for the baseURL. What is the correct syntax for referencing the javascript variable in an HTML module or the Help files?
          Examples I found in the Templates use the syntax {vb:raw baseurl} but this did not work in an HTML module....
          What is correct? I have tried.....

          Code:
          {$pageData.baseurl}        
          {vb:raw baseurl}              
          {vb:raw pageData.baseurl}    
          {vb: $pageData.baseurl}      
          {vb: pageData.baseurl}      
          $pageData[baseurl]          
          pageData.baseurl          
          $baseurl
          etc.


          TIA

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...