How must the redirect be created correctly in Magento? - redirect

Hello dear stackoverflow community,
I am looking for a 301 redirect for the .htaccess.
The following should be done by the redirect.
"example.com/be/nl" to "example.com/be_nl/"
and other URL's are in the old store:
"example.com/be/nl/XXXXX" is there a possibility to remove everything after /be/nl automatically?
Thanks for your help!
https://httpd.apache.org/docs/2.4/rewrite/remapping.html

Related

where to redirect old prestashop urls?

Hello could somebody please tell me where to redirect urls of old removed products from prestashop 1.6.0.9?
Is it right to redirect them to 404 page or to homepage? (whats better?)
AND HOW TO REDIRECT IT?
Actually when I type link of removed product to browser it redirects me to custom page of my website but just with warning in red rectangle:
1 error
1. Product not found
(see the attachment in link)
http://s11.postimg.org/wm2ho4b2b/image.jpg
Thanks in advance.
I think you had to use a 301 redirect. modify/create a htaccess file like this:
//redirect from URL to other
RewriteRule /old_url_of_product.html http://www.homepage_website.com/ [R=301]
First parameter are the old url, next are the new url.
This is the best way for SEO.

301 Redirect For SSL URL

301 redirect has me completely lost and confused so I would really appreciate if someone can help me with the code.
My website is www.dfwpcrepairs.com I recently purchased the SSL for my site and changed the site from plain HTML site to Wordpress. I kept all the URLs structures the same as they were before and used a plugin to keep the .html extensions in Wordpress for every URL/page on my site.
So Google Analytic tells me that I have a redundant URLs which I assume it is the non www and the www version of my site.
I want to redirect everything to the www/SSL version of my site/URL. Can someone please help me with the code for this?
I would greatly appreciate this.
Regards,
Rnaderpo
I would recommend you use a plugin for this instead of hacking into .htaccess file.
I personally use WordPress HTTPS (SSL) you can use any other you like.

301 redirect chain in html

I have searched on the internet and on your forum but just cannot find the code to write a chain redirect.
I understand that it is not good practice to redirect more than 3 times but I need to redirect two pages in my website both which have already been redirected once before.
My website is in HTML and I did the previous redirects on the .htaccess file.
I would like to redirect a second time but cannot find how to write this, would it be:
RedirectPermanent /old-page.html http://www.website/folder/new-page.html http://www.website/folder/new-page-two.html
OR
RedirectPermanent /old-page.html http://www.website/folder/new-page.html /folder/new-page-two.html
or do I redirect directly from the original redirected page?
The first redirect was done about three years ago.
I also need to tell Google that some of my webpages do not exist anymore. Can I put a 410 coding on the same .htaccess page or do I need a separate one or do I just delete them and tell Google through my Sitemap.xml?
I would be so grateful for your help with these confusing questions.
Thanks
I understand that it is not good practice to redirect more than 3
times but I need to redirect two pages in my website both which have
already been redirected once before.
It’s not a “bad practice” issue as you are describing. If a user visits /old-page.html how exactly are they going to go to two URLs from that? Is there any site on the Internet you have ever seen that?
I am assuming you want to have two different redirects. Which you can do like this:
RedirectPermanent /old-page.html http://www.website/folder/new-page.html
And then on www.website you do this:
RedirectPermanent /folder/new-page.html /folder/new-page-two.html
I also need to tell Google that some of my webpages do not exist
anymore.
So if you have a page that doesn’t exist, it should return a 404 & Google will know that. So what is the issue? Unless you want to force requests to 404. Then you would do something like this for a page like bad-page.html to 404 on each request:
RewriteEngine on
RewriteRule ^/?bad-page\.html$ - [R=404]
But it seems like you have very simple issues that you are overcomplicating.

Trying to redirect entire folder to website front page

Our site used to have a blog at oursite.com/blog
Years later, we're still getting many 404s for pages in the /blog/ folder.
How can I use htaccess to redirect the blog folder and all its contents to the front page of our site, oursite.com ?
I have tried a lot of things based on web research but the closet thing I found redirected things like:
oursite.com/blog/?p=3226
to oursite.com/?p=3226
I don't want it to work that way. All blog files no longer exist, so I just want to redirect ALL files from the blog just to the main front page, i.e. oursite.com so:
oursite.com/blog/?p=3226
or
oursite.com/blog/cool-permalink/
or
oursite.com/blog/image.jpg
or
oursite.com/blog/
would ALL simply point to oursite.com
Can you please tell me how to do this? I've spent many hours Googling it unsuccessfully...
Thanks a bunch in advance!
Michael
Create a .htaccess inside the /blog directory.
Add this line to .htaccess
ErrorDocument 404 http://oursite.com
That will take care of any URL that is requested in /blog/
If you want everyone to be redirected if the file doesn't on the whole domain no matter what directory they're in just put the .htaccess in your main directory.
If you are using Apache as your front-end, mod_rewrite is what you want to use. Something like
RewriteEngine On
RewriteRule ^/blog/.* /cool-permalink/ [R]

Redirect to a specific page on a DNN site with an extensionless URL

I have a page on my DotNetNuke site and I would like to set up a redirect and was wondering the best way to do it. Here is the problem:
I have a page on the site: mydomain.com/dashbaord.aspx. I would like users to be able to type mydomain.com/dashboard OR mydomain.com/Dashboard and it will redirect them to the /dashboard.aspx page.
I have IIS6, so I set up wildcard mapping, and it seemed to work for /dashboard, but not /Dashboard. Also, I am looking for it to literally redirect you so that /dashbaord.aspx shows up in the address bar. In addition, the wildcard mapping broke some other links on the site, so I was looking for an alternative method to accomplish this. Is there a way that I can set this up through IIS? Or any other way?
Thanks in advance for the help.
In IIS, create a virtual directory by right clicking on Sites, and then call it Dashboard. Then set that to redirect to a specific URL, in your case, http://mydomain.com/dashboard.aspx.