KaizenCoders
HomeURL ShortifyContact
  • Documentation
  • Announcements
    • 💰[IMPORTANT] Buy an annual/lifetime URL Shortify PRO plan at the old price until September 2, 2024
  • Account & Billing
    • Prorating Upgrades & Downgrades
  • URL Shortify
    • Getting Started
      • Features
      • Benefits Of URL Shortify
      • Integrations
      • How to install URL Shortify
    • API Documentation
      • Links
    • Frequently Asked Questions
    • Release Notes
    • How to create a short link
    • What is No Follow and Sponsored link?
    • What is Parameter Forwarding, Why to use it & How to implement in URL Shortify?
    • What is Link Tracking, Why do track links & How to do it with URL Shortify?
    • How to generate QR code of a short link?
    • How to Exclude Specific IP Addresses
    • How to import short links using CSV?
    • How to redirect to different urls based on device?
    • How to redirect to target url based on location?
    • How to enable/disable auto create link for Posts, Pages & any custom post types?
    • How to Filter Out Known Robots Clicks
    • How to setup custom domains in URL Shortify
    • Share short links on the different social media platforms
    • How to create UTM Presets & use it?
    • How to do Split test (A/B test) of short links?
    • How do we give link management access to other WordPress roles?
    • How to export Links & Clicks data?
    • Generate Short Links On Importing Posts through WP All Imports
    • Link Cloaking & Masking
    • Generate Short Links for Posts, Pages & Custom Post Types in Bulk
    • How to Set an Expiry Date for Short URLs in URL Shortify
    • Display Short URL Above, Below, and Within Post, Pages, & Custom Post Types Content
    • What is Link Rotations & How It Works?
  • Update URLs
  • Social Linkz
    • Page 1
Powered by GitBook
On this page
  • Apache Redirect
  • Nginx Redirect
  1. URL Shortify

How to setup custom domains in URL Shortify

To set up a custom domain in URL Shortify, first, you need to make sure your secondary domain is points to your main domain on which URL Shoritfy is installed.

Apache Redirect

If your secondary domain is not pointing to your main domain, you can do it via .htaccess file if your web server uses Apache. You can add the following lines to your .htaccess file located at the root of your secondary domain.

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
  RewriteCond %{HTTP_HOST} ^www.olddomain.com$
  RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]
</IfModule>

Nginx Redirect

When it comes to Nginx, that is handled within a .conf file, typically found in the document root directory of your site(s), /etc/nginx/sites-available/directory_name.conf. The document root directory is where your site’s files live and it can sometimes be in the /html if you have one site on the server. Or if your server has multiple sites it can be at /domain.com. Either way that will be your .conf file name. In the /etc/nginx/sites-available/ directory you’ll find the default file that you can copy or use to append your redirects. Or you can create a new file name html.conf or domain.com.conf.

This is how you can redirect your old URL to new URL

server { # Permanent redirect to new URL server_name olddomain.com; rewrite ^/(.*)$ http://newdomain.com/$1 permanent; }

Now, when you access your oldomain.com, it will redirect to newdomain.com along with the query parameter. After doing this, please add your old domain (secondary domain) into URL Shortify. You can add your custom domain from URL Shortify > Domains.

PreviousHow to Filter Out Known Robots ClicksNextShare short links on the different social media platforms

Last updated 10 months ago