There is a plugin that does exactly this:
https://wordpress.org/plugins/multiple-domain-mapping-on-single-site
Anyway, it would be nicer to have things under control with an understandable few lines of script, so I’m still open to answers
Related Posts:
- Moving wp-content outside of web root?
- Multiple domain names for one site
- How to always rewrite author archive page URL even if the author does not have a post
- Remove / from www.example.com/ [closed]
- Redirect home to another page with htaccess
- How to redirect URL with subfolder to the same URL but without subfolder?
- Best way to give site sub-page it’s own domain?
- Rewrite WordPress Standard Feed URL – /feed/ to feed.xml
- Displaying Post with Custom URL with RewriteRule or add_rewrite_rule
- Remove Trailing Slash from Category Base and Tag Base
- How to handle this URL Structure. Keep getting “page not found”
- rewrite taxonomy-{taxonomy}-{term}.php terms
- Confusion about Site url and directory
- Redirect to another page using contact form 7? [closed]
- wordpress.com website url structure [closed]
- hide wp-content from urls
- get_template_directory() returns wrong address on VPS
- Rewrite URL in address bar for a specific page [closed]
- Changed domain name and all the 301 redirects work except the ones for the thumbnail image which return 403 Forbidden error
- Change dynamically URL to SEO friendly via .htaccess?
- How to properly setup MAMP and XIP
- Inject dynamic strings in urls
- How To Change the URL of a WordPress Multisite
- Domain name to a page
- Two domain site: Link base URLs point to wrong domain
- wp-login.php ampersand in url results in 404
- How to redirect WP post with a specific word in the URL
- Append custom parameter to taxonomy/term URI
- Why my wordpress site URL does not begin with my domain?
- Standard Htaccess directives disappear by themselves
- My Website’s Main URL redirects me to an Archive Page
- Can’t change url because site address is greyed out
- Custom URL structure
- How do you retrieve a post by slug name through REST API?
- remove “index.php” from permalinks
- Why “?v=hash” is added to my URLs? [closed]
- Detecting a WordPress URL without doing a full HTTP GET?
- How does WordPress generate URL slugs?
- How does routing on wordpress work?
- Redirecting to old domain after migration
- Custom plugin route in WordPress
- Why is ?doing_wp_cron being appended to my URLs
- Unwanted media library URLs in posts?
- How to remove file versions from the file source links in wp_head?
- use query string in URL to display content on the page
- Change default URL path (/blog/) of blog posts
- Difference between esc_url() and esc_url_raw()
- Custom page with variables in url. Nice url with add_rewrite_rule
- How to deal with WordPress on localhost
- Problem with guids and absolute links
- How to add custom rewrite rule to .htaccess?
- How to convert the file path to a URL of the same file?
- Add menu and submenu in admin with a URL instead of slug?
- Update media file url in wordpress media library
- Why is WordPress saving full-urls to the database?
- htaccess rewrite conflict with wordpress rules and ssl
- Clash of the rewrites
- Rewrite rule page url with category
- Old blog/ and blog/feed/ URLs not working after moving blog to top-level via .htaccess
- Get taxonomy slug from url
- Load images with http urls inside https post
- Remove All Query Arg
- How to Rewrite WordPress URL for a Plugin
- Allow admin login at /admin
- Htaccess for Wordpess set on single subdomain
- Redirecting WordPress /.htaccess / HSTS / SSL
- URL Rewrite + Page + Custom Post Type = Unusual Redirect
- Pulling a parameter out of the URL of a WP link without “?” or being sent to a different page
- How to append a URL parameter to all outbound URLs
- WordPress on a subdirectory of Laravel – WordPress pretty permalinks inner page shows laravel
- How to remove /index.php/ from URL’s
- Run WordPress frontend and backend in different domains
- How to set global variable in functions.php
- Force the Website URL to Include “www” and to be Upper Case?
- How to remove “http://” When Echoing URL?
- Change logo url link
- WordPress and $_GET Params
- Can’t login after my site was moved to a new server
- WPML Get url without outputting
- SEO Friendly URLs for my plugin categories
- List of default WordPress URLs
- WordPress Custom Post Type Category Page
- Why WP encodes UNICODE (UTF8) containing urls? Any drawbacks of UNICODE url?
- Rewrite /?rest_route=/ link to /wp-json/ without changing default permalink structure in apache
- Adding a hook to ‘parse_request’ so that siteurl/pagename/xyz ignores “xyz”
- How to have numeric URLs in Posts and Pages
- Unable to load static front page on home url
- Why does wordpress still strip my query var?
- Remove subfolders from URL
- Force home page to be https?
- Hijacking the URL for filtering
- Why WordPress automatically removes http from the url of my website’s sub domain?
- add_query_arg() One Key with multiple values
- Custom rewrite rules are sending everything to index.php
- How to Add Pages Under Custom Post Type URL Structure?
- Weird: /?name in URL leads to blog
- custom htaccess rewrite rule for page
- How to add .htaccess code through a function?
- I am Looking to append URL Parameter to all URLs
- flexible rewrite ‘ramble’ URLs with WordPress