Customize URLs with Domain Mapping (by setting a subdomain (or domain) per country).

Features

  • Customize URLs with Domain Mapping (by setting a subdomain (or domain) per country).
  • Allow you to use the core app with multiple subdomains or domains.
  • Optimize your website SEO per sub-domain (or per domain).
  • Share session between subdomains of the domain of the main URL (APP_URL from the /.env file).

NOTE: This addon doesn't support subdomains of subdomains. The addon cannot also share a session between two distinct domains (like foo.com and bar.com). See also License & Domains for how license keys apply to subdomains and to additional domains.

Compatibility

  • v6.0.1 => LaraClassifier v19.1.3+ and JobClass v19.1.3+
  • v6.0.0 => LaraClassifier v19.0.0+ and JobClass v19.0.0+
  • v5.5.1 => LaraClassifier v18.3.0+ and JobClass v17.3.0+
  • v5.5.0 => LaraClassifier v18.2.0 and JobClass v17.2.0
  • v5.4.9 => LaraClassifier v18.1.1 and JobClass v17.1.1
  • v5.4.8 => LaraClassifier v18.1.0 and JobClass v17.1.0
  • v5.4.7 => LaraClassifier v18.0.3 and JobClass v17.0.3
  • v5.4.6 => LaraClassifier v18.0.2 and JobClass v17.0.2
  • v5.4.5 => LaraClassifier v18.0.1 and JobClass v17.0.1
  • v5.4.4 => LaraClassifier v18.0.0 and JobClass v17.0.0
  • v5.4.3 => LaraClassifier v18.0.0.beta and JobClass v17.0.0.beta
  • v5.4.2 => LaraClassifier (v17.1.0 to v17.1.1) and JobClass (v16.1.0 to v16.1.1)
  • v5.4.1 => LaraClassifier (v17.0.0 to v17.0.1) and JobClass (v16.0.0 to v16.0.1)
  • v5.4.0 => LaraClassifier v17.0.0 and JobClass v16.0.0
  • v5.3.6 => LaraClassifier v16.0.2 and JobClass v15.0.2
  • v5.3.5 => LaraClassifier v16.0.1 and JobClass v15.0.1
  • v5.3.4 => LaraClassifier v16.0.0 and JobClass v15.0.0
  • v5.3.3 => LaraClassifier (v15.4.0 to v15.4.1) and JobClass (v14.4.0 to v14.4.1)
  • v5.3.2 => LaraClassifier (v15.3.4 to v15.3.5) and JobClass (v14.3.4 to v14.3.5)
  • v5.3.1 => LaraClassifier v15.3.0+ and JobClass v14.3.0+
  • v5.3.0 => LaraClassifier v15.2.0 and JobClass v14.2.0
  • v5.2.4 => LaraClassifier (v15.1.4 to v15.1.6) and JobClass (v14.1.4 to v14.1.6)
  • v5.2.3 => LaraClassifier v15.1.4 and JobClass v14.1.4
  • v5.2.2 => LaraClassifier v15.1.3 and JobClass v14.1.3
  • v5.2.1 => LaraClassifier (v15.1.1 to v15.1.2) and JobClass (v14.1.1 to v14.1.2)
  • v5.2.0 => LaraClassifier v15.1.0 and JobClass v14.1.0
  • v5.1.0 => LaraClassifier v15.0.0 and JobClass v14.0.0
  • v5.0.2 => LaraClassifier v14.2.0 and JobClass v13.2.0
  • v5.0.1 => LaraClassifier (v14.0.2 to v14.1.0) and JobClass (v13.0.2 to v13.1.0)
  • v5.0.0 => LaraClassifier (v14.0.0 to v14.0.1) and JobClass (13.0.0 to 13.0.1)
  • v4.3 => LaraClassifier v13.0.0 and JobClass v12.0.0
  • v4.2 => LaraClassifier (v12.1.0 to v12.2.4) and JobClass (v11.1.0 to v11.2.4)
  • v4.1 => LaraClassifier (v12.1.0 to v12.2.4) and JobClass (v11.1.0 to v11.2.4)
  • v4.0 => LaraClassifier (v12.0.0 to v12.0.2) and JobClass (v11.0.0 to v11.0.2)
  • v3.9 => LaraClassifier (v11.0.2 to v11.0.4) and JobClass (v10.0.2 to v10.0.4)
  • v3.8 => LaraClassifier (v11.0.0 to v11.0.1) and JobClass (v10.0.0 to v10.0.1)
  • v3.7 => LaraClassifier (v10.2.1 to v11.0.1) and JobClass (v9.2.1 to v10.0.1)
  • v3.6 => LaraClassifier (v10.2.0 to v10.2.6) and JobClass (v9.2.0 to v9.2.6)
  • v3.5 => LaraClassifier v10.1.4 and JobClass v9.1.5
  • v3.4 => LaraClassifier (v10.1.2 to v10.1.3) and JobClass (v9.1.3 to v9.1.4)
  • v3.3 => LaraClassifier (v10.1.0 to v10.1.1) and JobClass (v9.1.0 to v9.1.2)
  • v3.2 => LaraClassifier (v10.0.1 to v10.0.2) and JobClass (v9.0.1 to v9.0.3)
  • v3.1 => LaraClassifier v10.0.1 and JobClass v9.0.1
  • v3.0 => LaraClassifier v10.0.0 and JobClass v9.0.0
  • v2.9 => LaraClassifier v9.0.1 and JobClass v8.0.1
  • v2.8 => LaraClassifier v9.0.0 and JobClass v8.0.0
  • v2.7 => LaraClassifier (v8.0.0 to v8.0.6) and JobClass (v7.0.0 to v7.0.6)
  • v2.6 => LaraClassifier (v7.3.6 to v7.3.8) and JobClass (v6.1.6 to v6.1.8)
  • v2.5 => LaraClassifier (v7.3.2 to v7.3.5) and JobClass (v6.1.2 to v6.1.5)
  • v2.4 => LaraClassifier (v7.3.0 to v7.3.2) and JobClass (v6.1.0 to v6.1.2)
  • v2.3 => LaraClassifier (v7.2.3 to v7.2.4) and JobClass (v6.0.3 to v6.0.4)
  • v2.2 => LaraClassifier (v7.2.1 to v7.2.2) and JobClass (v6.0.1 to v6.0.2)
  • v2.1 => LaraClassifier v7.2.0 and JobClass v6.0.0
  • v2.0 => LaraClassifier (v7.1.0 to v7.1.1) and JobClass (v5.9.0 to v5.9.1)
  • v1.9 => LaraClassifier v7.0.4 and JobClass v5.8.4
  • v1.8 => LaraClassifier (v6.9 to v7.0.3) and JobClass (v5.7 to v5.8.3)
  • v1.7 => LaraClassifier v6.8 and JobClass v5.6
  • v1.6 => LaraClassifier (v6.6 to v6.7) and JobClass (v5.4 to v5.5)
  • v1.5 => LaraClassifier v6.5 and JobClass v5.3
  • v1.4 => LaraClassifier (v6.2 to v6.4) and JobClass (v5.0 to v5.2)
  • v1.3 => LaraClassifier (v5.9 to v6.1) and JobClass (v4.7 to v4.9)
  • v1.2 => LaraClassifier (v5.7 to v5.8) and JobClass (v4.5 to v4.6)
  • v1.1 => LaraClassifier (v5.2 to v5.6) and JobClass (v4.0 to v4.4)
  • v1.0 => LaraClassifier v5.1 and JobClass v3.9

Installation

Step 1: Upload the add-on

Go to Admin panel → Extensions → Add-ons, click Upload add-on and drop the add-on's .zip file into the upload area (50 MB maximum). The archive is extracted into extensions/addons/domainmapping/ and Domain Mapping appears in the list, deactivated.

Cannot upload from the browser? Unzip the archive on your computer and copy the add-on folder to extensions/addons/domainmapping/ over FTP or SSH: its addon.json file must sit directly inside that folder. Then open Admin panel → Extensions → Add-ons. The page scans extensions/addons/ every time it loads, so the add-on is listed straight away (the Sync button runs the same scan on demand).

Step 2: Activate the add-on

Click Activate on the Domain Mapping card. It is a paid add-on, so a dialog asks for its purchase code, which is verified before anything else happens: an invalid code is rejected in the dialog and nothing is changed.

Once the code is accepted, activation runs in one pass: it creates the add-on's database tables (its migrations), registers its permissions, runs its seeders and publishes its public assets. Reload the page to see its new entry in the Add-ons section of the admin sidebar.

Step 3: Configure

Open Admin panel → Domain Mapping from the Add-ons section of the sidebar and set the add-on up: see Usage.

Purchase Code (License Key)

Domain Mapping is sold as a separate product, so it has its own purchase code (license key), distinct from the purchase code of the main application and from the one of every other add-on. You are asked for it when you activate Domain Mapping in Admin panel → Extensions → Add-ons.

Our products are sold on three platforms. The way you receive a purchase code depends on where you bought the product.

Platform / Marketplace How you get the purchase code Where to find it again
bedigit.com Store
In-site purchase (Shop)
Generated automatically when the order is paid, then sent by email, either in its own license email, or inside the order confirmation email. My Account → My Licenses on bedigit.com
Gumroad Created as soon as Gumroad notifies us of the sale, then sent in a separate email, in addition to the Gumroad receipt. The license email, your Gumroad Library, and My Account → My Licenses on bedigit.com
Envato Market
CodeCanyon
Issued by Envato, not by us, and never sent by email: you download it yourself from your Envato account. Envato account → Downloads → License certificate & purchase code
Check your spam folder. For both bedigit.com Store and Gumroad purchases, the purchase code is delivered by email. Automated license emails are very often filtered, so if the message is not in your inbox, look in your spam / junk folder before contacting support, and add our sender address to your contacts or allow list.

1. bedigit.com Store (in-site purchase)

  • As soon as the order’s payment status becomes Paid, a license key is generated automatically for every licensed item in the order (one key per purchased unit: buying 3 units gives 3 distinct keys).
  • It is emailed to the address used on the order, either in a dedicated license email or inside the order confirmation email. Check your inbox and your spam / junk folder.
  • The key stays available in your account under My Account → My Licenses. Keys are masked in the list; open the license detail page to reveal and copy the full key, see the domains it is activated on, and deactivate a domain to free an activation slot.
  • The matching invoice is under My Account → My Orders.

2. Gumroad

  • A Gumroad purchase produces two separate emails: the Gumroad receipt (sent by Gumroad, giving access to the files) and a license key email (sent by bedigit.com) that contains your purchase code.
  • The license key email is generated as soon as Gumroad notifies us of the sale, so it normally arrives within seconds of the payment. Here too, check your inbox and your spam / junk folder.
  • When the Gumroad product uses Gumroad’s own license-key feature, the same key also appears in your Gumroad receipt and under Library → your purchase on gumroad.com.
  • Use the same email address on bedigit.com as on Gumroad: your keys are then linked to your account automatically and listed under My Account → My Licenses, even if you register after the purchase. You can also add a Gumroad key manually from My Account → My Gumroad Licenses.

3. Envato Market (CodeCanyon)

  • Envato purchase codes are issued and delivered by Envato Market, never emailed by us, so there is nothing to look for in your spam folder: you retrieve the code from your Envato account.
  • Log in to your Envato / CodeCanyon account, open the Downloads page, find the item, and choose License certificate & purchase code from the Download dropdown. The code is written in that certificate.
  • An Envato purchase code looks like 12345678-90ab-cdef-1234-567890abcdef (8-4-4-4-12 characters). It never changes, and renewing item support does not issue a new one.
  • Official Envato article: Where Is My Purchase Code?
Lost your purchase code? Search your mailbox (spam folder included) for “license” or “purchase code”, then check My Account → My Licenses on bedigit.com for Store and Gumroad purchases, or Downloads → License certificate on Envato. If it is still missing, open a ticket on our Help Center with your order number (Store), Gumroad sale ID or buyer email (Gumroad), or Envato username and item name (Envato).

License Key, Subdomains & Domains

Every license key (the one of the main application, the one of Domain Mapping and the one of any other add-on or theme) is validated by our license server against the domain of your website. With Domain Mapping, one installation answers on several hosts, so here is how they are counted.

Hosts mapped to your countries Counted as License keys needed
Subdomains of your main domain
example.com, www.example.com, fr.example.com, de.example.com, …
One website One key per product: your LaraClassifier or JobClass key, your Domain Mapping key and the key of each other add-on cover all these hosts, whichever host was used first.
Additional domains
example.fr, example.de, example-france.com, …
One website per domain One key per product and per domain: each additional domain needs its own license key for LaraClassifier or JobClass and for each add-on or theme you use on it, Domain Mapping included.
  • A subdomain is any host that ends with your main domain: fr.example.com and www.example.com belong to example.com; fr.example.co.uk belongs to example.co.uk. Anything else is a distinct domain.
  • Your main domain is the host of the APP_URL variable of your /.env file. Install the application and validate your license keys from that domain.
  • Keys for an additional domain are entered in that domain's own settings: Admin panel → Domain Mapping → Domains, Settings button of the domain, App section, Purchase code field.
  • You can see the domains each key is activated on, and free a slot, under My Account → My Licenses on bedigit.com.
Example. A site serving France on fr.example.com, Germany on de.example.com and Spain on example.es needs one set of keys for example.com (covering fr. and de.) and a second set of keys for example.es.

Updating

An update only replaces the add-on's files. Its database tables and data, its settings, its activation state and its recorded purchase code are all kept, so do not deactivate or remove the add-on before updating it. Back up your database first all the same.

Method 1: Upload the new version (recommended)

  1. Download the latest .zip file of the add-on.
  2. Go to Admin panel → Extensions → Add-ons and click Upload add-on.
  3. Drop the .zip file into the upload area.
  4. Because Domain Mapping is already installed, a prompt shows the installed version and the new one. Click Replace: the extensions/addons/domainmapping/ folder is swapped for the new files. Cancelling the prompt discards the upload.

Method 2: Replace the files by hand

  1. Over FTP or SSH, delete the extensions/addons/domainmapping/ folder and upload the new one in its place. Replace the whole folder rather than copying over it, so files dropped by the new version do not linger.
  2. Open Admin panel → Extensions → Add-ons: the page re-reads addon.json and the card shows the new version number.

After the files are replaced

Apply the database update. Some versions of this add-on ship an update routine (database migrations and data fixes). When the new version has one, an Updates available banner appears in the admin panel. Go to Admin panel → System → Updates, find Domain Mapping under Paid add-on updates and click Apply updates. Every pending version is applied in order, and the page records it in the update history. The routine is only offered while the add-on is active: if you replaced the files of a deactivated add-on, activate it first.

If your installation caches its configuration or routes (php artisan config:cache, route:cache), run php artisan optimize:clear after the update.

Usage

The add-on adds a Domain Mapping menu to the Add-ons section of the admin sidebar, with Domains, Add domain and Settings entries.

Before adding a domain

  • Create an A (IPv4) or AAAA (IPv6) record for the domain (or subdomain) in the DNS zone of your domain provider, pointing to your server.
    INFO: An A record, or AAAA record, points a hostname at an IP address. It can point your domain name at your web host or create subdomains that point directly to an IP address.
  • Add the domain (or subdomain) in your hosting control panel (cPanel, Plesk, …) as an alias that points to the root directory of your website (public_html for example).

Domains

Go to Admin panel → Domain Mapping → Domains and click Add new, or use the Domain Mapping → Add domain menu entry, which opens the same form. You can add only one domain (or subdomain) per country, and a host can only be used once.

FieldDescription
CountryThe country served by this domain.
HostThe country's domain or subdomain, without http:// or https:// (e.g. fr.domain.com or nouveaudomaine.fr).
HTTPSEnable it when the host is served over HTTPS (it has an SSL certificate).
ActiveOnly active domains are used.

The Bulk Create Sub-Domains button creates a <country code>.<main domain> subdomain (e.g. fr.example.com, with HTTPS off) for every active country that has no domain yet. The main domain is taken from the APP_URL variable of your /.env file.

When a visitor browses the main domain with a country that has its own active domain, they are redirected to that domain.

Per-country pages

Each row of the Domains list has three buttons, under Per-Country Pages, to customize the website served on that domain. Each page starts with the main website values: click its Generate… button to copy them for the domain, then edit the copy. The Remove… button deletes the customization and the domain uses the main values again.

  • Settings: per-domain copy of the main settings groups (App, Listing form, Listings list, Mail, SMS, SEO, Localization, Security, Social auth, Social links, Pagination, Other), e.g. a different site name, logo or email configuration.
  • Homepage Sections: per-domain order, activation and options of the homepage sections.
  • Meta Tags: per-domain SEO titles, descriptions and keywords of the pages.

Settings

Go to Admin panel → Domain Mapping → Settings.

FieldDescriptionDefault
Share session between sub-domainsShares the login session between all the subdomains of the main domain (the host of APP_URL). It cannot share a session between two distinct domains. Saving a change to this option updates SESSION_DOMAIN and SESSION_COOKIE in your /.env file, so every user, you included, is logged out.On

Admin panel URL

  • If you have enabled the session sharing between subdomains, use the Admin panel through the main URL from the /.env file followed by /admin (APP_URL/admin).
  • If you have disabled the session sharing, the Admin panel is accessible on each domain or subdomain (e.g. us.domain.com/admin, fr.domain.com/admin, ...).

Optional: countries list as homepage

  • This add-on can show the countries list page as the homepage of the main domain. To do that, set the DM_COUNTRIES_LIST_AS_HOMEPAGE variable of the /.env file to true (add it if it doesn't exist in your /.env file). The option only works while the Domain Mapping add-on is active.
    The main domain (the host of the APP_URL variable) then shows the countries list at its root URL, and, on the country domains, the links to the countries list point to that homepage.
    NOTE: Set a domain (or subdomain) for every country (e.g., example.de, fr.example.com, ...) so that the main domain (the one of the APP_URL variable of your /.env file, e.g., example.com) can show the countries list page as homepage.

Translation

To translate this addon into your language:

  • Go to the addon languages directory in the core app's /extensions/addons/domainmapping/resources/lang/
  • Duplicate the folder /extensions/addons/domainmapping/resources/lang/en/ to /extensions/addons/domainmapping/resources/lang/<code>/
    NOTE: Don't forget replace <code> by your language code (e.g. "de" for German language).
  • Open the file /extensions/addons/domainmapping/resources/lang/<code>/messages.php and translate it.
    NOTE: To translate the file, you must change the values and not the keys of the PHP array.

Uninstallation

Switching an add-on off without losing anything is a deactivation: go to Admin panel → Extensions → Add-ons, click Deactivate on the Domain Mapping card and confirm.

  • The add-on is no longer loaded: its routes, views, admin sidebar entry and front-end pages stop answering.
  • Its database tables and all the data they hold are kept, and its files stay under extensions/addons/domainmapping/. Nothing is deleted.
  • Its permissions and its recorded purchase code stay in the database. Only Remove deletes them.
  • Deactivation is refused while another active add-on depends on this one: deactivate that add-on first.

Click Activate on the same card to switch it back on. As for a first activation, the purchase code is asked for and verified again; then any pending migrations run, the assets are republished, and the add-on picks up exactly where it left off.

Removing

Removing is permanent and destroys the add-on's data. The Remove button only appears on a deactivated add-on, so removal is always two steps:

  1. Deactivate Domain Mapping (see Uninstallation).
  2. Click Remove on its card and confirm the prompt.

The admin panel then, in one pass:

  • runs the add-on's uninstall hook, if it ships one, while its code is still on disk;
  • revokes the permissions declared in its addon.json;
  • rolls back its migrations (this drops its database tables and every row they hold) and purges its entries from the migrations table, so a later reinstall migrates from scratch;
  • deletes its published assets: public/addons/domainmapping/, public/vendor/domainmapping/ and storage/app/public/addons/domainmapping/;
  • deletes the add-on directory extensions/addons/domainmapping/;
  • deletes its row in the addons table (the recorded purchase code goes with it) and clears the application cache.
This cannot be undone. Back up your database before removing an add-on whose data you may still need: installing it again later creates empty tables, not your old content, and asks for the purchase code again.

Removal is refused, with an explanatory message and before anything is destroyed, when the add-on is still active, when another active add-on depends on it, or when the web server (PHP) user cannot delete extensions/addons/domainmapping/. In that last case, give that user write permission on the directory and on its parent, then try again.

Deleting the folder over FTP or SSH is not equivalent: the add-on is only switched off, and its tables, its entries in the migrations table and its addons row are all left behind. Use Remove in the admin panel instead.

Was this article helpful?

Thank you for your feedback!

Still need help? Create a support ticket

Create a Ticket