A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [wp-redirect]

Redirects the user to a specified absolute URI.

Filter by
Sorted by
Tagged with
0
votes
0answers
22 views

Is this consindered safe redirect?

Here is the code: (all pages are internal) $URL = get_permalink( get_page_by_title( 'page-slug') ); $subURL = get_permalink( get_page_by_title( 'sub-slug') ); if( is_main_site() ) { if ( ...
0
votes
1answer
10 views

How To Redirect /url.html to /url?

I want to rediret mysite.com/page-url.html/ to mysite.com/page-url/ how can i do that ? I tried to create page rule in cloudflare like this - mysite.com/.html to mysite.com/ but it's not working.
0
votes
0answers
35 views

wp-admin Redirects to Docker Container Name

RESOLVED The fix was to add proxy_set_header Host $host; to my nginx file in the location block. ___________ When I try to reach /wp-admin I am redirected to the container's name instead of my site ...
1
vote
1answer
16 views

Login redirects and query strings

I have a number of sites that every so often become the subject of multiple IP address brute force attacks. I use the wonderful Limit Login Attempts which rebounds them but the logging is a pain in ...
1
vote
2answers
65 views

Cannot modify header information - headers already sent by pluggable.php

I'm trying to develop a simple plugin but I'm having a problem: I have a custom WP_List_Table in an admin page, but when I click on a button like "Edit Row" or "Delete Row" it performs some expected ...
0
votes
0answers
19 views

Wordpress redirects me to posts page after I update / preview any page

Need some help since my wordpress behaving weird. Wordpress is redirecting me to post page everytime I update / preview any page. Changes I made in the page doesn't get saved though. I don't have ...
0
votes
0answers
21 views

All pages redirecting to homepage

All links on my site are redirecting to homepage. WPDev-Redirect-Trace-01: /home/domain.com/public_html/wp-includes/canonical.php : 607 wp_redirect("https://www.domain.com/",301) WPDev-...
0
votes
0answers
9 views

Restrict access to certain pages

I have a custom /search-results/ page. I would like users only to have access to that page once they have submitted my custom search form and if they do try and access it directly they must be ...
1
vote
1answer
32 views

NextGEN Gallery Lightbox - Social Share URL Redirect

I am using NextGEN Gallery Pro - Lightbox's Social Share feature on my WordPress site which actually create and share a temporarily created url (first-url) on social media. Somehow the redirect doesn'...
0
votes
0answers
36 views

WordPress Stopped Redirecting Shortened Child URLs

I'm currently on WordPress 5.3 and just noticed that at some point, shortened URLs stopped working. And what I mean by "shortened" is that you used to be able to just type in the final part of the URL,...
0
votes
0answers
18 views

Multiple permalink structure for the same post

I am using WooCommerce and my client would like to have 2 versions of permalink structures for single product pages as follows: example.com/product-slug/ and example.com/product-category/product-...
1
vote
0answers
13 views

Redirect 404 page with ID in slug to associated page with same ID in slug

I got URL's like this: test.com/redirect/p563328-18/ This are pages / urls that doesnt exist (404) but we have custom post types (vacatures) with posts that have the same "id" in the slug: test.com/...
0
votes
1answer
15 views

Looking to redirect a link

Looking to redirect a certain item on a page to a subdomain. The code I want to replace is simply changing the HREF link. I can't seem to find the code though. <div data-id="4" class="item item4 ...
1
vote
0answers
13 views

I get redirected too many times only in wp-admin?

I am trying to run wordpress in a subdirectory blog in my rails app, I used this nginx config as: server { listen 80; server_name _; passenger_ruby /usr/local/bin/ruby; passenger_enabled ...
0
votes
0answers
26 views

get_queried_object_id combined with wp_redirect gets wrong id

I have the following snippet of code that I am experimenting to restrict access to certain wordpress pages through a plugin. It works... almost. The browser is redirected to the login page, but the ...
0
votes
1answer
14 views

Crazy redirect happening with no redirects set up

I have a website https://createandgo.com If you hover over 'Design' in the top menu, then click 'How To Write A Blog Post' it adds like 21 URL extensions: https://createandgo.com/blog-writing-tips/-...
0
votes
0answers
6 views

login password required after redirection to a new domain

I am in need of your assistance. I have deployed a password protected wp site to a new domain. After changing the sites URL and home page to a new domain (and cleared cache and checked in other ...
0
votes
1answer
77 views

How to remove trailing slash from root Wordpress folder?

My WordPress in installed in a folder, https://example.com/folder/. I would like WP index page to get accessed by https://example.com/folder, however, WP 301 redirects it to https://example.com/folder/...
0
votes
0answers
13 views

Create a login form where the login users are redirected

Is it possible to do such a thing? <?php if ( !is_user_logged_in() ) { ?> <!-- Users not logged in --> <form id="wp_login_form" action="" method="post"> ...
0
votes
1answer
31 views

How to customize file path for 404 redirection in php?

I made a plugin with a custom post type postcard. Most of postcards are private. I would like to redirect the logged out user in a specific php file inside my plugin instead of the 404.php or achive....
0
votes
1answer
23 views

How to 301 redirect sub domain post URL to root domain

We have a subdomain which is implemented in WordPress: https://blog.aisee.co.in/ and it has more than 2000 posts in it. As per SEO perspective, we wanted to migrate the subdomain to the main root ...
0
votes
0answers
17 views

Can't redirect a 404 page using plugins

I changed a permalink on my Wordpress site which was previously set as index.php/%postname%/ to /%postname%/ Since my site pages are already indexed, people get 404 pages now. I tried redirecting ...
0
votes
1answer
26 views

How Do I Redirect a Wordpress Website?

I have a staging Wordpress site with HostGator at http://subdomain.domain1.com (This is not the actual domain, however it is a subdomain of an existing domain.) I purchased a new domain from ...
1
vote
1answer
107 views

Redirect /%year%/%monthnum%/%day%/%postname% [closed]

Need to redirect to new structure /%year%/%monthnum%/%day%/%category%/%postname% Saw code that helped before but can't seem to find it. Updated theme and lost the code that went into functions.php. ...
0
votes
0answers
20 views

How do I set another domain for WP automatic redirects that is not the default domain?

I just migrated my blog from subdomain to subfolder. Then, I realized some old permalink changes on my blog posts are not redirecting correctly. The thing is, when in WP admin, my domain looks ...
0
votes
0answers
12 views

Prevent non-existing CPT to redirect

I'm using a CPT articles. I would like urls like ./articles/2186 to be able to exist even if i don't have any CPT Article with 2186 as slug. No 404, no redirect, just loading the correct single-...
0
votes
0answers
16 views

stop redirection on /wp-login

I've installed a modified version of Wordpress with "Duplicator" There is a problem loading the page I think it's in the redirection How can I stop it? http://mysite/wp-login.php?redirect_to=http%3A%...
0
votes
0answers
38 views

Redirect Child Category to Parent Category Post Permalink

I changed my permalink structure to /%category/%postname/ and its okay, My site post permalink is now https://example.com/categoryname/postname/ Now the issue is, I am having child category, It ...
0
votes
2answers
180 views

Is this a correct usage of ob_start() in my WordPress project?

I have extended WooCommerce to create a custom endpoint. This endpoint, points to a template that has a form to save user meta data. When the form is submitted I want it to redirect to another URL. ...
0
votes
0answers
20 views

Code custom redirect url after woocommerce registration

I'm trying the code for redirect url after registration, but its not working. I tried other options, I used the plugin, but it's same not work. I use registration form in "my_account" page. Could ...
0
votes
2answers
14 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
12 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
75 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
122 views

How to auto login after registration? [duplicate]

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
17 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
119 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
34 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
19 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
18 views

Overiding wp_sanitize_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
29 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
270 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
21 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
27 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
24 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
2answers
730 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
14 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
1answer
247 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
1answer
55 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:...
0
votes
1answer
76 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
769 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/...