Jump to content

.htaccess 301 redirection not working


Petra
 Share

Recommended Posts

Hello everyone,

I am a newbie in the world of website editing and I have been given a task to figure out how to redirect a long list of some old client's web pages which give 404 error. We have been able to redirect about two thirds of url's by using php database. Unfortunately the rest does not work, using php, due to containing special characters and the command I have tried to generate for couple of web pages, using the tool https://websiteadvantage.com.au/HtAccess-301-Redirect-Generator#heading-ToolResult  is not working using the .htaccess file.

Would anyone be able to help with the following example?

1) https://www.berlitzpraha.cz/en/eshop/individual-language-courses?orderby=product_name
... to be redirected to https://www.berlitzpraha.cz/en/language-courses-berlitz-shop-online/individual-language-courses-3

command generated with the tool (not working):
RewriteEngine On
RewriteCond %{QUERY_STRING}  ^orderby=product_name$ [NC]
RewriteRule ^en/eshop/individual-language-courses$ https://www.berlitzpraha.cz/en/language-courses-berlitz-shop-online/individual-language-courses-3? [R=301,NE,NC,L]

2)
http://www.berlitzpraha.cz/cs/skupinove-kurzy-jazyku/hledani/zkouset/function.implode ... to be redirected to https://www.berlitzpraha.cz/cs/skupinove-jazykove-kurzy-pro-firmy/

command generated with the tool (not working):
RewriteEngine On
RewriteCond %{HTTP_HOST}  ^www\.berlitzpraha\.cz$ [NC]
RewriteCond %{QUERY_STRING}  ^$
RewriteRule ^cs/skupinove-kurzy-jazyku/hledani/zkouset/function\.implode$ https://www.berlitzpraha.cz/cs/skupinove-jazykove-kurzy-pro-firmy/? [R=301,NE,NC,L]

3)
https://www.berlitzpraha.cz/en/language-courses-berlitz-shop-online/virtual-language-courses?orderby=product_sku&showall=1 ... to be redirected to https://www.berlitzpraha.cz/en/virtual-language-courses-shop-online/virtual-language-courses-4

RewriteEngine On
RewriteCond %{QUERY_STRING}  ^orderby=product_sku&showall=1$ [NC]
RewriteRule ^en/language-courses-berlitz-shop-online/virtual-language-courses$ https://www.berlitzpraha.cz/en/virtual-language-courses-shop-online/virtual-language-courses-4? [R=301,NE,NC,L]

 

Thank you very much in advance.

Petra

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...