Internal paths

You web site or your web application can be put everywhere, in a domain (eg. or in a subfolder (eg.
If you install X3 CMS in the final location, X3 automatically will set right value for all internal paths.

What if you need to move X3 CMS to another location?


You need to edit the .htaccess file, here you have to change the path in a few rows
You have 2 elements: the domain name and the subfolder if exists

errorDocument 403 http://YOUR_NEW_DOMAIN/SUBFOLDER_IF_EXISTS/msg/message/_page_not_found
errorDocument 404 http://YOUR_NEW_DOMAIN/SUBFOLDER_IF_EXISTS/msg/message/_page_not_found 
RewriteEngine On
# remove comment redirect all traffic with www and without www to the same domain 
RewriteRule ^(.*)$ http://YOUR_NEW_DOMAIN_WITH_WWW/$1 [L,R=301]


In the database you have 2 changes:

  1. Edit the domain field in the sites table
  2. If you move to a subfolder or from a different subfolder you need to change all the image and href paths in the content field in the table articles
    To solve run this query after a backup
    UPDATE  articles SET content = REPLACE(content, '="/old_subfolder/', '="/new_subfolder/')

Other paths

X3 CMS define some shortcuts that help you write code easily:


The ROOT is the portion of the URL between the domain name and the language code. In the examples below the ROOT is formatted as bold:

  • (the slash after .com)
  • (the slash after .com)

NOTE: the ROOT starts and ends with a slash


The BASE_URL = ROOT + language_code + / + area_name + /

Is very useful when you need to write an internal link, see the example below

<a href="/en/admin/articles/edit/2/en/1/<?php echo BASE_URL ?>page_name" title="a page">a page</a>

This way you don't care about language code and area name, X3 CMS will set those of the page where you are.


The THEME_URL is a shortcut to the folder of the theme of the area where you are. Useful to link theme's elements. See the example below

<img src="/en/admin/articles/edit/2/en/1/<php echo THEME_URL ?>img/my_image.jpg" alt="image caption">


PATH is the absolute path of X3CMS in the computer


APATH is the absolute path of the application folder (for X3 CMS the application folder is cms) in the computer


FPATH is the absolute path to the files folder in the application folder with the prefix foer the domain
FPATH = DOCUMENT_ROOT + ROOT + 'cms/files/'+PREFIX+'/filemanager/' 

* DOCUMENT_ROOT is the document folder of your web server

Have you a question?