Wordpress Home page URL changing to /?i=1 - issue - wordpress

When I try to access my Wordpress website directly or from google, the Home page URL automatically adding /?i=1 and sometimes /?i=2 to the URL in the address bar.
I think it's a very simple to solve it, but I tried many things and didn't work.
So I wonder how can I solve this to be only the URL without /?i=1 or /?i=2 ?

/?i=1 or /?i=2 protects your website from bots and is mostly applied by free hosting services and if you use any .htaccess code to remove it than all ? parameters will removed and redirect you to homepage

Try resetting your wordpress permalink from admin end. If you don't know how to do that check this video. As this is not normal behavior of wordpress you can also check your .htaccess file.

RewriteCond %{QUERY_STRING} ^(.*)i=[^&]+(.*)$ [NC]
RewriteRule ^(.*)$ /$1?%1%2 [R=301,L]
Add this in htaccess

Related

Redirect one image to webpage Issue

I hope everyone is well.
I am having a few issues trying to redirect an image that was linked in error from an email to a html page.
For example the email points here - https://www.caravanguard.co.uk/news/wp-content/uploads/2021/03/Swift-Vogue-580-1.jpeg
But should point here - https://www.caravanguard.co.uk/news/make-mine-a-dealer-special-caravan-25644/
I have appplied the following to our .htaccess, but it does not appear to have worked. I have also done the same in the wordpress yoast plugin we use.
redirect 301 /news/wp-content/uploads/2021/03/Swift-Vogue-580-1.jpeg /news/make-mine-a-dealer-special-caravan-25644/
Any ideas?
With your shown samples, could you please try following. Please make sure to place these rules at top of your .htaccess file. Also please do clear your browser cache before testing any URLs.
RewriteEngine ON
RewriteRule ^news/wp-content/uploads/2021/03/Swift-Vogue-580-1\.jpeg/?$ /news/make-mine-a-dealer-special-caravan-25644/ [R=301,NC,L]
You can use a RewriteRule
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/news/wp-content/uploads/2021/03/Swift-Vogue-580-1.jpeg$
RewriteRule ^.+$ /news/make-mine-a-dealer-special-caravan-25644/ [R=301]
Make sure this rule is at the top of your htaccess or before your WordPress rules.
Had to remove the image from wordpress before it would allow the redirect to work. WP rules seem to have got in the way. The .htaccess rule I originally created then kicked in.
I tried the above comments prior to the deletion and they did not work. Cheers for your help both.

Redirect To A Custom Url Depending on Location on wordpress with parameters

I need to redirect my store customers to another clone installation in a sub-directory.
For Example:
A US visitor can visit: ‘example.com/product’
When a Canadian visitor visits the same link, it should redirect to: ‘example.com/ca/product’
I have tried out a few geo redirection plugins but the issue is as follows:
The redirection goes to ‘example.com/ca’ and the ‘product’ part is left out.
Any fixes?
NOTE: I have a clone installation of ‘example.com’ on ‘example.com/ca’.
I didn't need such a comprehensive multilingual plugin setup in my wordpress installation. So I have just used multi-site and added this to my htaccess file to redirect users to my 'irish' site based upon browser language config:
RewriteCond %{HTTP:Accept-Language} ^ie [NC]
RewriteCond %{REQUEST_URI} !ie [NC]
RewriteRule ^(.*)$ https://yoursite.com/ie [L,R=301]
I hope this is a quick and easy fix for someone. As I tried doing an action in functions.php and kept going around in circles for an hour!
You should use the plugin WPML for multilanguge. With this plugin you can use the option redirect by language WPML > Languages > Redirection according to browser language. I have it set up like this in a website of mine and it works fine.
If you want do it trought IP, you will need to add some more work. Im sending you info, I hope it is useful for you:
https://wpml.org/forums/topic/autoselect-native-language/#post-284007
http://wordpress.org/plugins/geographical-redirect/
https://wpml.org/forums/topic/how-to-detect-ip-location-and-automatically-display-local-language/

.htaccess wordpress multisite redirect between subsites

I am building a new site for a client. we preserved the old site in a wordpress multisitesolution. Now it's time to migrate into the new site. Problem is the old site is heavilly embedded in Google Search with many active links. So I need a way to catch and redirect each and every link that comes our way.
I can redirect old.sitename.com to new.sitename.com directly - this works fine. Problem is when I get direct links to posts or pages.
Som this is the syntax I need resolved
old.sitename.com/an-article-read-this --> new.sitename.com/an-article-read-this
I have tried several .htaccess commands, including a few wordpress addons. Even simple ssl with .htaccess redirect enabled.
RewriteRule ^old.*$\% https://hoppla.heiledeg.no/%{REQUEST_URI} [R=302,NC]
direct links keeps opening up in the old site. not the new one.
Yes I have refreshed cache. And even tested on "fresh" browsers.
Any ideas, tips, or even addons are very much appreciated.
for me this was the solution:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(old.)?olddomain.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [L,R=301]

Redirect one specific Wordpress URL to another site for mobile users in htaccess

Need some syntax help if someone would be so kind. I have one page on my Wordpress site (http://www.thisweekonmv.com/vineyard-map) that I need to redirect to another website's URL for mobile users only. I would like to do this in .htaccess, but so far all of the solutions I've researched online haven't worked.
This is what I have that isn't working...I probably am close but something is definitely wrong?
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|operamobile|palmos|webos|googlebot-mobile" [nc]
rewriterule ^vineyard-map(.*)$ http://myatlascms.com/map/?id=938$1 [r=301,nc]
Refer this links
https://wordpress.org/support/topic/how-to-redirect-links-for-mobile-using-htaccess
Mobile Redirect using htaccess

Redirect/block WordPress URLs with the /?p=x structure. Eg. site.com/?p=2

I'm building a site with hashed permalinks so I can email a test.com/aedoiu2348791lkd style URL to a client. It's to provide a level of privacy without the need to log in or dick around with passwords.
Unfortunately, WordPress redirects any URL with the ?p=x url structure:
so mysite.com/?p=2 redirects to mysite.com/about
Obviously, the hashed URL is pretty useless when someone can run through /?p=xx and see every post and page I've ever made.
Is there a way to stop WordPress from redirecting this type of link and either throwing a 404 or redirecting to the homepage?
I only want the page to be accessible from the "proper" mysite.com/asdfghj-page style of URL.
Solution ...sort of
Added to top of .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} /?p=(\d*)
RewriteRule ^$ *? [R=404,L]
</IfModule>
I don't really get it... but this works.
Ideally it would redirect to the wordpress 404 page, however.

Resources