Hello,
I have noticed that I have some 404 errors on my website. I have tried to fix them by putting the following instruction in the .htaccess but it does not work:
Redirect 301 /urlwith404 https://mydomain.com/home
Investigating through the forum, I have seen that OLS does not accept 'Redirect 301' as instruction, but that it must be done with 'Rewrite Rules'. So, I've done the following redirection, but it only works if I put it above of the RewriteRule of the Wordpress index:
RewriteEngine On
RewriteRule /urlwith404/ https://mydomain.com/home [L,R=301]
Can you tell me why it only works if it's on above of the Wordpress Rewrite Rule?
I have also tried to do the redirects creating a context of type 'redirect' in the virtual host, but it does not work.
Admin Control Panel -> Virtual Hopt -> MyVirtualHost -> Context Tab -> Add -> Redirect Type:
URI: /urlwith404/
External redirect: No
Status Code: 301 Moved permanently
Destination URI: https://mydomain.com/home
I have also tried to do the redirections creating a context of type 'static' in the virtual host, but it does not work either.
Admin Control Panel -> Virtual Hopt -> MyVirtualHost -> Context Tab -> Add -> Static Type:
URI: /
Location: $VH_ROOT/html/
Accesible: Yes
Enable Rewrite: Yes
Rewrite Rule: RewriteRule /urlwith404/ https://mydomain.com/home [L,R=301]
What am I doing wrong? Can you help me or explain how to do it?
I have noticed that I have some 404 errors on my website. I have tried to fix them by putting the following instruction in the .htaccess but it does not work:
Redirect 301 /urlwith404 https://mydomain.com/home
Investigating through the forum, I have seen that OLS does not accept 'Redirect 301' as instruction, but that it must be done with 'Rewrite Rules'. So, I've done the following redirection, but it only works if I put it above of the RewriteRule of the Wordpress index:
RewriteEngine On
RewriteRule /urlwith404/ https://mydomain.com/home [L,R=301]
Can you tell me why it only works if it's on above of the Wordpress Rewrite Rule?
I have also tried to do the redirects creating a context of type 'redirect' in the virtual host, but it does not work.
Admin Control Panel -> Virtual Hopt -> MyVirtualHost -> Context Tab -> Add -> Redirect Type:
URI: /urlwith404/
External redirect: No
Status Code: 301 Moved permanently
Destination URI: https://mydomain.com/home
I have also tried to do the redirections creating a context of type 'static' in the virtual host, but it does not work either.
Admin Control Panel -> Virtual Hopt -> MyVirtualHost -> Context Tab -> Add -> Static Type:
URI: /
Location: $VH_ROOT/html/
Accesible: Yes
Enable Rewrite: Yes
Rewrite Rule: RewriteRule /urlwith404/ https://mydomain.com/home [L,R=301]
What am I doing wrong? Can you help me or explain how to do it?