You can use a predefined constants that points to site URL.
(from Codex)
define('WP_SITEURL', 'http://example.com/wordpress');
define('WP_HOME', 'http://example.com/wordpress');
Small example
define('WP_SITEURL', 'http://'.$_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://'.$_SERVER['HTTP_HOST']);
Related Posts:
- Changing domain
- how to get my WP site’s IP? [closed]
- WordPress site redirects to different wordpress domain on the same server after reuploading db backup
- How to let a single post have its own domain name
- Custom domain for sub-section of parent website
- Website redirecting to old domain name
- Redirect one of two domains on one WordPress installation
- Redirecting to old domain, tried everything, nothing works
- forward domain name to particular page?
- How to redirect URL with subfolder to the same URL but without subfolder?
- How can I replace my primary url globally with a parked one?
- WordPress Multisite Strange Redirect on Primary Site
- Missing domain http://./wp-… in redirects
- redirect second domain to static page
- Parked domain redirecting to wrong error404 page
- How can I disable redirect domains?
- When i try to enter subdomain i’m redirected to main domain
- Can’t login to WordPress admin panel after changing domain to use WordPress pages as a fallback from React
- Automatically switch language based on visitor’s country
- domain redirects to subdomain
- All devices on my network redirect me to an old domain
- Local domain remap with proxy : Infinite 301 redirect, bad URL typo
- Multisite hide subdirectory
- Multisite redirect loop for a single www domain
- How to map secure.domain.com to www.domain.com or domain.com with “WordPress MU Domain Mapping” on the primary multisite domain?
- Is RewriteMod for WordPress site: site.ro -> site.com/?lang=ro possible?
- Why is WordPress redirecting from http to https on a local environment?
- How to use alias domain for multisite installation?
- How to display a raw HTML page (bypassing WordPress theme, scripts, etc)
- Non-WordPress page in subdirectory under WordPress page
- Clarification on auth_redirect()
- Restrict Access to wp-login.php
- Problem to redirect custom page using htaccess
- WordPress within a subdirectory of another WordPress environment doesn’t work
- wp-login.php — redirect logged in users to custom URL
- How to do 301 redirect to Sub page using htaccess file?
- Redirect feed to 404 page
- Does WordPress automatically redirect url without parent slug?
- Redirect guest if he tries to access a specific page
- Localhost wordpress site redirects to public site
- Redirect homepage ( www.sitename.com ) to the latest post
- Redirect all post into some category to url without category
- What is the right way to redirect all traffic to HTTPS?
- If User is NOT Logged in and Page ID is not 6 – Redirect to Login
- Where’s the redirect happening? [closed]
- Front end user creation form! How do you keep the user on the same page in event of error?
- URL redirect problem
- How to redirect if a background request is still being executed
- WP site in infinite redirect loop
- Regex with HttAccess
- WordPress keeps redirecting subpages without http to https homepage after switch
- Redirect non-existent subpages to second part of url
- https – too many redirects
- How to remove the [L] Flag for WordPress index .php mod_rewrite
- How do I display the main domain for my WordPress install?
- ReDirect subfolder link to another sub-folder and force SSL
- How do I remove the RSS Feed Redirect?
- Why does WordPress redirect when I separate wp-core and wp-content?
- Redirect user to original url after login?
- User redirect to specific URL after logging in
- What is the most efficient (ie. less server intensive) way for 301 redirects?
- Redirect non existing page to frontpage
- How do I do a redirect to WordPress permalink with post id via htaccess?
- Redirect user on first visit based on geographical location
- Create a permalink to a pdf?
- My site doesn’t redirect from HTTP to HTTPS
- Bedrock WordPress
- Redirect User to login page
- Redirect After Login Error
- Is it possible to detect if a POST action is for a “Save Post” before the save_post action?
- Disable and Hide WP-JSON
- URL redirection
- Redirect when not logged and parametr in link
- Browsers Forcing Multisite to https
- Is it possible to change redirect template through a shortcode?
- Keep the old referrer after failed login
- How to 301 redirect WP posts id “/c/94940894” to permalink with post name?
- WP 301 redirect does not work
- URL redirect regular expressions redirecting all after first viriable
- 301 Redirect Link to Media
- WordPress Redirect post to outside website based on useragent
- How to create mass 301 redirects with PHP in Nginx server without using a WP plugin
- HOW do you Redirect buddypress login to EDIT tab not PROFILE tab on profile page? [closed]
- WordPress redirects to backend when i’am not logged in
- Redirect to custom admin menu after plugin activation
- home page redirect loop after update to 4.8
- 301 Redirects when change URL in WordPress database
- How can I redirect to another page with screen already at the bottom of the page?
- How is this URL being redirected?
- What’s the best way to redirect to a new wordpress website?
- 301 Redirect only for posts
- How to move a https website back to dev and access the admin?
- Why is WordPress redirecting to homepage after GET form submit?
- Redirect after user changes password
- URL is redirecting (301) when query string is passed through URL
- Hide page for user logged and redirect for profile? [duplicate]
- Redirect URL while building site
- Redirect ignore last URL segment
- Creating custom link that redirects to a another link
- Other pages fine but wp-admin showing ERR_TOO_MANY_REDIRECTS Error