Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [wp-redirect]

Redirects the user to a specified absolute URI.

0
votes
2answers
12 views

Why https://www. SUBdomain is redirected by WP to https://MAINdomain

Hi there could somedoby explain please why https://www. SUBdomain does not redirect to https://non-www.sudomain I am running nginx and seems like set up all the redirects but the one above seem to be ...
0
votes
0answers
8 views

Taxonomy in taxonomy permalink structure

I have a custom post type advert and two taxonomies advert-category and advert-location. By default it looks like: .../ads/advert-category/ archive for categories .../place/advert-location/ archive ...
0
votes
3answers
48 views

Redirect after login based on user role (custom login page)

I created a custom login page and everything is OK but there is an issue. I want to redirect users to different pages based on their roles after login. My code is below but I do not know why it is not ...
0
votes
1answer
23 views

How to auto login after registration?

I create an user using $user_id = wp_create_user($username, $password, $email); After creating the user I want them to auto login and so according to ravi patel, I have added the following code in ...
0
votes
1answer
13 views

Unable to properly login

First of all, sorry if the question is not clear the first time, it's a bit tricky to explain. Here's the issue i've got: I have a website running locally with mamp pro. Site name is dev.site (the ...
0
votes
1answer
16 views

Redirect website domain (including all pages) to external URL after Popup message (few seconds)

I am new to wordpress and I have made custom code as below. Where I can place this custom code in wordpress. I want to redirect the website domain and all pages but wanted to display popup message for ...
0
votes
1answer
20 views

Disable Wordpress URL auto Redirect

Wordpress auto redirect http://example.com?lang=fa to http://example.com/?lang=fa how to stop that?
1
vote
1answer
17 views

Redirect user to previous page after signup from custom form

I've looked on here and found lots of references to this, but none have worked for me, probably because there must be something in the custom code I am modifying that I don't quite understand. Having ...
0
votes
1answer
14 views

Overiding wp_santitize_redirect for | character

I am not really conversant with php and I have an issue with wp_sanitize_redirect. I have seen this excellent question and answer: wp_sanitize_redirect strips out @ signs (even from parameters) -- ...
0
votes
1answer
26 views

Problem in redirect link in wordpress

I created a login page in wordpress and redirected the page to another website . Now, after clicking the login icon from the menubar it redirects to another page. Thats fine. But I cant access the wp-...
1
vote
1answer
74 views

WordPress Redirect Not Working - AJAX Callback Response Not Picked Up

I cannot get a redirect working in my custom wordpress plugin. I have a button on a page which triggers an AJAX action which calls a function. In my function (which is definitely being called as I ...
0
votes
0answers
19 views

How to redirect attachment page to actual file URL

I have a minor problems with my blog. When I click on attachment page, it automatically redirect to the actual file attachment. For example: When I click on: http://localhost/blog/my-media-file ...
0
votes
1answer
11 views

saving variables after redirect

Is there a way to save a variable after you redirect to another page. For example... I want to save the password submitted from my form into the variable $temp_passkey, and be able to access it on the ...
0
votes
2answers
20 views

wp_redirect doen't work

I am writing a simple plugin to accept a user number, show a form with information about the user, then post a payment amount. The user number is obtained from this http file include_once(...
1
vote
1answer
286 views

header and wp_redirect not working. cannot modify header information warning

Does anyone know another way to redirect without header(); giving me this error? wp_redirect doesn't work for me either... This is the error I'm getting: Warning: Cannot modify header information -...
0
votes
0answers
10 views

how to redirect folder and its subfolders to subdomain

i have a wordpress blog and i have changed my "uploads" folder to subdomain. My previous address was like this. https://guilaneman.ir/wp-content/uploads /.../.../ my new url: https://images....
0
votes
0answers
18 views

Non-www is redirect to admin page

The website is redirecting domain.com (non-www) to the admin login page. I don't want that. www.domain.com is showing the website in a correct way. Anyone knowing the problem with the non-www ? ...
0
votes
1answer
63 views

Php function 301 redirect

I am using this code so that when the user visits the old permalink, he gets redirected to the new one. add_action( 'template_redirect', 'redirect_to_external_url' ); function ...
0
votes
0answers
18 views

Redirect problem on login page

I've create a custom page with a login form but I have a problem. When try to login I automatic redirect to my same login page (in my case I have the form on home page) and ULR change from www.mysite....
0
votes
1answer
32 views

Detect what link user clicks and Redirect to a specific page for logged in users only

I have a link in my WP website Account link. I would like this to work normally for logged out users. However for Logged-in users i would like this link to take them to another page url. I have tried:...
-1
votes
1answer
35 views

Redirect specific link for logged in users only to specific URL

i have a custom Woocommerce link that adds a product to the cart and redirects user to the account page: account/?add-to-cart=15169 I'd like this link to redirect only logged-in users to some ...
0
votes
2answers
306 views

main-domain of wordpress keep redirecting to subdomain

I was in process of deploying my wordpress website mysite.com/NewSite to mysite.com during the deployment I messed up something and my main site has started redirecting from mysite.com to mysite.com/...
-1
votes
1answer
194 views

Cannot modify header information - headers already sent

So I have a form on one page, which is submitting to admin-post.php, then there is a function in functions.php which is processing the form. It stores the input field data to database and then after ...
0
votes
0answers
109 views

wp_redirect() function does not redirect to another page

I have a form on one page and submit it to admin-panel.php, where in functions.php I have a function which takes the input data, stores it in database and then the user should be redirected to another ...
-1
votes
1answer
295 views

show payment receipt in woocommerce thankyou page with custom payment gateway?

I'm developing a payment gateway for WooCommerce with my client's bank that provides an API and actually I can process the payment correctly, but I need to show the transaction receipt in the thankyou ...
1
vote
1answer
40 views

Redirect a page based on last word in slug

I have a couple custom post types registered = Staff, Properties If I have a page with the slug archive-staff, how can I automatically redirect that page to the Staff CPT archive page with a php ...
0
votes
1answer
8 views

Internal redirect from page to category

I want to implement a page, let's say /today-deals that will show all posts under today category, like if we were navigating to /category/deals-for-october-31-2018 but without changing the URL.
0
votes
0answers
40 views

Frontend registration form doesn't save data only redirects to wp-login

I have another wordpress dilemma... I've built a frontend registration form, but for some reason whenever a user tries to register it doesn't work, and they get redirected to wp-login.php. The ...
0
votes
1answer
64 views

Redirect regex misbehaving when placeholder empty

I have the following 2 redirects active: /code-examples/(.*) -> /tutorials/android/$1/ and /code-examples/android/(.*) -> /tutorials/android/$1/ The first one has a higher position, so the ...
0
votes
1answer
145 views

Redirect to first child in menu

I have the following page hierarchy: Page Grandparent (This page) Page Parent 1 (Should direct here) Page Parent 2 Page Child Page Child Page Parent 3 Page Parent 4 My parent and child pages have ...
0
votes
1answer
21 views

Wordpress Redirect After logging

The following code below allows to me authenticate user against a custom table I created: function authentication($emailAdd, $password) { include_once('././wp-includes/class-phpass.php');...
0
votes
1answer
29 views

How to after saving or publishing a post redirect back to the original page

When viewing a list of posts on the admin page wp-admin/edit.php I click on edit. I then finish editing the post, click on save or publish and expect to be returned to the original admin listing page ...
0
votes
2answers
60 views

So how to redirect category to a page of the same name if it exists?

So I had previously tested a specific redirect where I knew the page exists. function nepal_template_redirect() { if ( is_category( 'nepal' ) ) { $url = site_url( '/nepal' ); ...
0
votes
1answer
25 views

How to fix automatic redirects?

All page links of my wordpress website are automatically redirecting with additional string which looks like this "/#.W6nTIaV-7pE" eg: https://supremeip.com/Trademark https://supremeip.com/Trademark/...
0
votes
1answer
84 views

“Cannot modify header information” means I can't use wp_redirect

I am working on a site where new users are expected to agree to read our site policy before they can proceed. Once a new user logs in, they are redirected to the policy page. To continue to the read ...
0
votes
1answer
16 views

Redirect /member/ to /member/user

Is it possible if an user is loggued to redirect /member/ to /member/user ? (User is the display_name) If yes, how can I do this ? Thank you ! :) thanks to Jack, I tried to search on google "Wp-...
0
votes
0answers
13 views

wp_redirect not working when adding custom fields

I am trying to redirect when the admin clicks on the "Draft" button. The code is below $draft_txt_change = 0; function test_post_status(){ global $draft_txt_change; $year = date("Y"); $month = date("...
0
votes
1answer
148 views

Custom URL redirect in WP

I am trying to make my own redirect page for external link. My target My target is that, when a user open the link www.mysite.com/wp/GoTo/?URL=www.google.com, the browser open the page www.google....
0
votes
0answers
131 views

wp_logout() not working after form submission

I am pretty new to Wordpress, so please forgive me if this sounds like a silly question. I have a Wordpress Page which is using the default page.php template in my theme. I modified the page.php ...
0
votes
1answer
269 views

wp_redirect leading to an infinite loop

Goal: I have modified the permalink to show the category name for a specific category: grill-rezepte. By default the permalink is: https://website.com/post-title just the grill-rezepte is now: https:/...
0
votes
2answers
202 views

Notice: Undefined index: mtral_field_subscriber

Notice: Undefined index: mtral_field_subscriber in /wp-content/plugins/redirect-after-login/redirect-after-login.php on line 54 Warning: Cannot modify header information - headers already ...
1
vote
2answers
54 views

WordPress Global Redirect

I need to expand on this discussion Redirect entire website to a single page to include two pages rather than one. On this site, I need two pages to be live and all others to redirect to the home ...
1
vote
1answer
85 views

How to use Regex to add to a url?

Right now I have a bunch of old blog posts that I need to update to the new url structure. I added /blog/ to all of the new url, and old existing links just have the old format without the /blog/ ...
0
votes
3answers
42 views

Redirection problems

Please help me to overcome the redirection issue. I need to work on subdomain rather than working on the main domain but here both domain is different. What I did is - copied all (website.com) files ...
1
vote
1answer
24 views

Why my deleted url is redirecting to random post?

I am currently working on a multisite. I have deleted one of my microsite, let's say the microsite url is mysite.com/barrie/, but after deleting my microsite it's url is redirecting to a random post ...
1
vote
1answer
86 views

Custom pagination structure

Currently my pagination works like http://example.com/city/usa/ #for page 1 http://example.com/city/usa/page/2 http://example.com/city/usa/page/3 ...and so on I want to change ...
2
votes
2answers
73 views

Redirect users on specific post category or category page

im trying to redirect users on specific categry with this hook: // Show app-data posts only to app users function user_redirect() { if ( is_category( 'app-data' ) ) { $url = site_url(); ...
0
votes
1answer
32 views

How to redirect new registrars to a custom registration page instead of WP default registration page?

How to redirect the user from this page domain.com/wp-login.php/action=register to another page?
1
vote
1answer
24 views

How can I redirect to my custom page without loading the Dashboard itself?

I'm creating a page using: /** * Add the admin menu item, under Appearance. */ public function addAdminMenu() { $page = add_theme_page( esc_html__( 'Setup' ), esc_html__( 'Setup'...
0
votes
1answer
376 views

Why does my wp_safe_redirect output the ERR_TOO_MANY_REDIRECTS error?

I've built a demo page and now I'd like to redirect on it whenever an user logs in and hasn't set up his theme, my code being: function add_admin_page() { if ( empty( $_GET['page'] ) || $_GET['...