Hi @user2924:
Use the 'template_redirect'
hook; put the following in your theme’s ‘functions.php’ file:
add_action( 'template_redirect', 'yoursite_template_redirect' );
function yoursite_template_redirect() {
if (strtolower($_SERVER['HTTP_HOST'])=='www.domain-b.com')
wp_safe_redirect('http://www.domain-a.com/pagex'.$_SERVER['REQUEST_URI']);
exit;
}
Related Posts:
- Logout redirect to home page
- check first time login only
- How to change the default logout link on WordPress Admin
- Redirecting old permalink to new one
- WP auto redirects after url change?
- Setting a redirect cookie in wordpress
- Redirect users after first login
- Redirect to current page after wordpress login
- How does WordPress redirect to WooCommerce shop page? [closed]
- 301 Redirect Custom URL hierarchy to WordPress Posts
- $_SESSION variables lost during OAuth callback
- 404 redirection and Google’s index [closed]
- Redirect user after logout
- WWW to non WWW redirect effects on load speed
- Wp Login redirect strips parameters from url
- 302 redirect to signup with nginx reverse proxy
- How to redirect user to specific page based on the input password
- Strange redirection issues on wordpress from ssl with padlock to ssl without padlock
- Redirect HTTP to HTTPS
- Change gravity forms confirmation redirect query string to include entry id [closed]
- How to redirect visitor to a custom URL using PHP code in functions.php
- Deny access to a path (give 403 or 404 response)
- Redirect home to another page with htaccess
- How do I redirect /search/ to ?s=
- 301 Redirect Loop
- Infinite loop behind SSL proxy on non-standard port
- Redirect from home page to post list page?
- set up 301 redirect within wp-content/uploads/ directory of a WP site to a new image URL
- How to redirect user after login to a specific page?
- .htaccess rule to redirect old URLs to new structure [closed]
- .htaccess Redirect
- Redirect when accessing /login when logged in
- How can I redirect a URL to an anchor link while maintaining the URL?
- How to remove duplicate and unnecessary part in a url using htaccess and regex?
- Built-In Postname Redirection vs Hard Redirects in relation to SEO and performance
- Local Environment Stripping Port Number…help tracking down the redirect?
- User is logged in after Stripe payment, then redirected, but is then logged out again
- How To Fix A Redirect Chain
- Redirect “http://old.net/category/postname” to “https://new.com/postname”?
- Image URLs not redirecting properly
- After logout browser’s back button into twenty sixteen theme profile
- 301 Redirect Old URL to New WordPress Page
- Login Redirect – Multiple Scenarios
- URL masking of subdomain to main domain using .htaccess
- Redirect outside WP after login
- Redirecting from wp-content?
- Redirect non existing page to frontpage
- How do I do a redirect to WordPress permalink with post id via htaccess?
- WP page 404 error only on mobile
- Redirect user on first visit based on geographical location
- How do I write a subdomain redirect?
- Redirect only Blog posts to new
- htaccess redirect from specific urls of my site to the homepage
- Can’t make redirect in WordPress
- Unwanted slug in my website
- HTTPS to HTTP rewrite rules not working as expected
- Changing permalinks and redirecting urls
- Preventing Canonical Redirect for CDN
- htaccess 301 Redirect not working from aspx to new WP permalink
- Mass .htaccess URL Forwarding
- How to point a public URL to internal (hidden) server with all links following.
- Redirect posts to new domain
- 302 Redirect is showing in the audit but links are opening separately
- How do I redirect the browser to 404 page, if no posts are found in home page
- Redirect after the registration
- Conditional Login Redirect
- wp_logout_url redirect not working
- How do i make WordPress return 404 instead of redirecting on misspelled page?
- how to redirect non logged users to login page and redirect to another page with saved data?
- How to redirect if 404 error in wordpress then redirect 404.php url
- WP Redirect with Wild Card Characters
- How to automatically redirect category pages (301) when changing the location of a category in the hierarchy
- 301 Redirects from old WordPress domain
- Unexpected: WordPress redirects to the WP_HOME/WP_SITEURL value
- Automatically switch language based on visitor’s country
- Do redirect 301 for wordpress page
- How to redirect user to Referrer Page using wp_signon in Custom Login Page in WordPress
- How to make front page temporarily show content of internal page
- How to get user details by name
- custom error message or redirect to custom page if any error occurs
- redirect after account activation for forum using bbpress and buddypress
- redirect_to ignoring the SSL
- One set of Child Pages redirecting to Home page?
- Redirect wordpress website URL into other link
- Redirect old .html URLs to a new installation in a subfolder
- Serve wordpress regardless of the cname
- Pass original URL through after login redirect
- Headers already sent error after upgrading wordpress to 4.2.2
- Blog post URL redirects to a Page URL who’s slug is a prefix of the post slug.
- Blog posts redirecting to random 404 pages
- Subpages return 404 server error
- WordPress 302 Redirect to Holding Page
- Converted posts to a CPT, 301 redirects necessary?
- Accept (once only) policy page on login
- Rewrite rule to redirect to a particular filename.php
- Redirect to other page when mobile
- Why my htacess rewrite return 404?
- woocommerce shop page Redirect Help
- problem redirecting users to page on login
- Create a 301 Redirect automatically when adding %category% in the permalink