redirect url doesn't work - .htaccess

I set up a website in a folder, with a redirect: my_site.com/folder/index.php redirects to my_site.com.
I updated the site, and moved it to the root. So I don't need that redirect anymore. It's now my_site.com.
However ... I got a few complaints from visitors who bookmarked it, and can't get there anymore. So I tried to set up a redirect, but that doesn't work. It throws a loop:
You cannot redirect "my_site\.org\/folder\/index\.php" to "http://my_site.org" as this will cause a redirection loop because "/home/folder/public_html" is the document root of one of your domains.
(I removed the actual address.) How do I solve this problem? Some visitors are looking with their browsers for an url that no longer exists.

Related

Redirect link to id on page

I would like to make a redirect from one link to another. I mean:
I have a site:
www.mysite.com/index.php and I can do it as www.mysite.com/home, so in URL user can see home instead of ugly index.php. But... Here comes the problem... I need to make a redirect from www.mysite.com/index.php#myId to www.mysite.com/myId.
I tried a lot of things via the .htaccess file but nothing worked. Is there any way to do it?

htaccess redirect specific pages to another domain

I’m having some real problems with 301 redirects in my .htaccess file.
I have about 20 pages on an old site that I need to redirect to pages on a new site. The URL structure of the new site is totally different.
Here’s one that I tried:
Redirect 301 /dan-carr-gear-list/travel-gear https://dancarrphotography.com/gear/travel/
Unfortunately, this doesn’t work.
What happens is that you get redirected to https://dancarrphotography.com/gear/travel-gear/ for some reason.
I just can’t figure it out.

301 redirects keep going to page not found

I am currently working on a website. I was not the developer but i am doing the fixes. The plugin simple 301 redirect is being used to redirect the dead site pages to the new live site. The issue is that even tho the url's for the old site is correct and so are the new ones, some of the old url's redirect properly but others are going to page not found. Any advise?

Redirecting URLs to a new subdomain with Open Cart

I have recently moved a client's e-commerce Open Cart site from theirdomain.com to shop.theirdomain.com and replaced theirdomain.com with a standard local business wordpress site.
The move went smoothly, however there are a number of pages from the original theirdomain.com that are still indexed in Google and are displaying 404 errors obviously.
I want to add 301 redirects to these pages in the htacess file to their respective subdomain pages, but when I tried the following code, the redirect worked, but the page wouldn't load properly.
Redirect 301 /carb-caps http://shop.theirdomain.com/carb-caps
It would take me to a page like this http://shop.theirdomain.com/carb-caps?route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps&route=carb-caps
I understand that this is typical of Open Cart...
The page loads fine without the redirect in place, but as soon as I add the redirect to the htaccess file, it just doesn't load.
Any ideas?
Thanks in advance!

301 redirects not working properly. Numbers in URL being ignored

I have just replaced my old non-Wordpress site with a Wordpress site. Now I need to redirect approximately 400 old URLs to their equivalent pages on the new site.
I have already recorded all the old urls and new urls, but when I put the code in the .htaccess file I am getting a strange result.
If I try to redirect to any url that has a number in it, the redirect tries to redirect to that url minus the numbers.
For example:
Redirect 301 /international_organizations/africaamerica_institute http://nyintl.net/international-organizations-in-new-york/2792/africa-america-institute/
Redirects to http://nyintl.net/international-organizations-in-new-york/africa-america-institute/
Which isn't actually a page and thus returns a 404 error.
Anyone have any idea what's going wrong? All my posts on the new site have the month/year syntax in the url, so this means that 95% of my redirects aren't working.
All the urls that don't contain numbers are redirecting perfectly.
I have made sure to put all my redirects ABOVE the WP rewrite rules, but that hasn't made a difference (tried them below as well).

Resources