Redirects to the page even if url is wrong - wordpress

Hello I have a problem that in my opinion is linked to permalinks, but I'm not quite sure.
The problem is that my site does only care about the last part of the argument in the url.
For example https://apriori.photo/kontakty/price does not exist. But it 301 redirects to https://apriori.photo/arenda-fotostudii/price/
I tried deactivating all the plugins and setting a default wordpress theme, the problem stays.
My permalink structure is : /%category%/%postname%/

WordPress has a feature where it automatically tries to redirect to a page which it deems to be 'the correct page' based on it's name. In your case, because the page ends with 'price', WP finds another page with a similar path and thinks it should redirect there.
To prevent this, you can disable the redirect using the following:
// In functions.php
remove_action('template_redirect', 'redirect_canonical');

Related

How to stop WordPress from automatically doing a redirect?

I have a site running on WordPress, and it will automatically redirects URLs it thinks are written incorrectly.
For example, if I go to a URL that doesn't exist. Like this one:
www.example.com/blah-blah/my-page-slug/
will redirect me to...
www.example.com/my-page-slug/
How can I stop this redirection? I want to generate a 404 error if the wrong URL is typed in, not redirect.
Place this in your theme's functions.php file.
remove_action('template_redirect', 'redirect_canonical');

Where does wordpress store redirects?

For example.
I create new page with permalink /test1
then after publishing I change the permalink to /test2
then if I browse to /test1 I get redirected to /test2
It looks like somewhere wordpress has stored a redirect from test1 to test2. However I can't find it anywhere.
Can someone please help me figuring out what is going on?
Thanks.
I'm using the Avada theme by themefusion. The only redirect plugin installed is simple 301 redirects. This plugin doesn't store redirects automatically and I do not believe that this plugin creates a problem. As the "problem" also occurs on other wordpress websites which do not have simple 301 redirects installed
Wordpress does that by default. If you want to remove that functionality try with adding remove_filter('template_redirect', 'redirect_canonical'); to your theme's (preferably child theme's) functions.php file.

Wordpress index.php redirect

I've just installed WordPress and I want to work on the theme. So I need to have an under construction page. I made an under.html file and addressed it in the .htaccess file as a default page.
But when I want to go to mydomain.com/index.php to see the WordPress main page and work on the theme, It redirects to mydomain.com again and shows me that under.html.
Any solution to have both under.html as the default page and the wordpress first page at the same time?
If you want to show an under construction page, you can simply use a plugin.
https://wordpress.org/plugins/wp-maintenance-mode/
Hope this will work for you.

Specific WordPress permalinks link to wrong page

I have a somewhat strange issue with WordPress today. This behaviour has only begun in the last week or so as far as I can ascertain.
Any page with the slug "downloads" links to it's parent page instead of to it's own page.
I have tried the following:
Reset permalinks to default and then back to %postname%
Disabled all plugins
Physically cleared the cache
But none of the above fix the issue. The weird thing is that this behaviour is only happening for pages with the slug "downloads". For all other slugs it is fine.
For example there are multiple instances of the slug "get-involved" with different parents and all work fine. But when the same is done with "downloads" the links redirect to their parent. Is anyone else experiencing this issue?
I have also verified in fiddler that the pages are not redirecting, they are actually linking to the parent page with a response code of 200, there is no 301 or 302 thrown.
WordPress will automatically duplicate the same slug with a new name but you should check again, maybe you've re-writing slug manually before. And check your .htaccess.

Changing WordPress URL structure - Redirects

I'm changing my URL structure from domain.com/postname to domain.com/type/postname
What's the best way to redirect? I tried using the Redirection plugin, but it seems that I need to redirect each URL manually. Is there any way to redirect all the posts at once?
Go to the wp-admin's dashboard using domain.com/wp-admin. Then look for the Settings-->Permalinks option. From this page you can change the URL settings for all of your posts.
Here are some instructions on how to redirect your sites url.
Changing the site url
Back up your site first if you still can? When I changed to pretty permalinks I had to include a forward slash to custom field images.
from: wp-content/uploads/2012/08/tulip-813-01.jpg
to: /wp-content/uploads/2012/08/tulip-813-01.jpg

Resources