function redirect_user() {
if ( $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] == 'www.abc.com/' ) {
if ( ! is_user_logged_in() ) {
wp_redirect( 'http://www.abc.com/de/' );
exit;
}
}
}
add_action( 'init', 'redirect_user' );
Do you mean something like this?
Related Posts:
- How to redirect user after login to a specific page?
- How to redirect if a background request is still being executed
- Make a treatment before the action of the form
- PHP header(Location: …): Force URL change in address bar
- WordPress localhost site redirect to live site
- WordPress Redirect All HTTP requests to HTTPS via .htaccess
- wp_redirect() function is not working
- My wordpress multisite homepage redirects to signup page
- Login redirect to previous page
- Prevent access to single post types
- WordPress install enters an infinite loop
- WordPress HTTPS redirect loop
- 301 redirect not working through .htaccess
- handling login/logout redirects
- Using `auth_redirect` : keeps asking me to login even when I’m logged in
- 302 redirect instead of 301 after switch to HTTPS
- How do I skip wordpress’s 404 handling?
- Redirecting to home-page when saving any edited code
- Temporary redirect prevents getting $_POST array
- Can WordPress redirect to a “similar page” in case of 404 error
- Hacked website redirect, only on desktop, help with restoring it [closed]
- Can I check for maintenance mode before redirecting to subdomain?
- How to create a 301 redirect that doesn’t apply to subsites
- WordPress blocking/preventing viewing of .cgi file in subdirectory [closed]
- Custom Registration page – prevent redirect to wp-login.php?action=register
- How to target specific user role?
- How to auto login after registration? [duplicate]
- homepage redirects to login page when user session expires
- How to redirect user to a specific page based on username?
- Redirect blog archive into certain format
- htaccess 301 Redirect not working for WordPress site
- Auto-detect the redirect url from the original url
- How can I replace my primary url globally with a parked one?
- WordPress Auto-Redirecting on 404
- My website on checking showing 403 error on HTTP Status [closed]
- Redirecting Pages That No Longer Exist — But Could in the Future
- How do I determine what is causing a redirect for a given page?
- Trouble running local WordPress in Google App Engine
- Empty folder being created by WordPress, breaks site
- About to migrate site to new domain
- Redirect all users to dashboard unless custom post type
- Redirecting connection from IP to localhost
- WordPress directing to Posts page (edit.php) instead of saving post
- How to forward all requests starting with a specific folder name to the same folder
- Issue redirecting ‘blog’ to ‘news’ in WordPress using .htaccess
- Custom Login Form – Redirect user to login page if not logged in
- Use two different index pages
- How to redirect from one WP site to another
- Extra Text in URL
- wp_redirect and current_user_can issues
- WP_List_table with form of method=GET redirects to wrong url after submit
- WordPress localhost site always redirect to live site [closed]
- Redirect wordpress website’s subpage to root [closed]
- My Cloned WP site keeps redirecting to the old one
- Can’t do 301 Redirect, Why?
- WordPress Permalink Problem 404
- How can I set up a splash page that is redirected to only one time for the visitor? [closed]
- Is there way to redirect all blog post pages to Home page?
- Interested in redirection techniques for one-page themes
- Select post from dropdown and add query args not working
- Trying to map a PURL like url to a page
- A question about .htaccess
- Can’t login to WordPress admin panel after changing domain to use WordPress pages as a fallback from React
- Why do my new WordPress pages redirect to home / staging site?
- WordPress multi domain: page redirect to main domain whenever WordPress do the URL guessing issue
- Puzzled at HTTP/2 301 response header
- date based redirect in wordpress
- Applying ‘middleware’ to a url before redirecting? Does WP have built in mechanism for this?
- How to regenerate RSS feed URL like FeedBurner?
- ErrorDocument 410 gives me back a 302 header
- ERR_TOO_MANY_REDIRECTS when switching from good database to old database
- Redirect to /404/
- Mailjet Email Subscription + Redirect w/ Custom Template Fails
- domain redirects to subdomain
- Post Click Redirect to Custom URL instead of Single Post Page
- htaccess Redirect 301 doesn’t work. How to debug?
- Having a different landing page for returning users
- How to create multiple Rewrite-Rule for various site in single htaccess?
- how can i find malware code and remove from wordpress site to stop it redirecting to hackers click view pages
- Redirect after plugin activation
- Redirect affecting development folder
- All devices on my network redirect me to an old domain
- how to write 301 redirect code for woocommerce product
- WordPress multisite and redirect to subpage
- wp-login.php redirect problem
- How to redirect 404s that generated for css&JS files?
- Custom, conditional redirect on logout
- International characters in slugs to redirect to
- login page not working [closed]
- Debugging a redirect loop affecting only certain pages
- WordPress redirect to splash page once a day for the first week
- noheader on the user/frontend side
- Solution for WordPress URL structure changes and 301 redirects?
- WordPress redirect from one directory to another but exclude wp-admin and wp-login.php
- How can I redirect foreigners by IP to other URL in WordPress?
- How to change Ugly link?
- WordPress site redirecting to developers URL
- How to use the HTTP API (wp_remote_get) instead of cURL?
- How to create a redirect to another domain like safe redirect manager from php
- Post Migration Site Migration Redirects All Known Solutions Attempted