redirect 301 error

#1
we had hosted our website at Nginx server at that time we have to use htaccess to redirect for Ex-
Redirect 301 /news/02/04/good-news-for-para-teachers-its-just-a-matter-of-days-hemant-government-serious-about-demands-of-para-teachers /good-news-for-para-teachers-its-just-a-matter-of-days-hemant-government-serious-about-demands-of-para-teachers/

its work fine but when we migrate to openlitespeed out htaccess rule not working.
 

Pong

Administrator
Staff member
#2
1, this is LiteSpeed Enterprise forum and for OLS, you should use https://forum.openlitespeed.org/
2, OLS doesn't support such directives, only LSWS supports it.
3, LiteSpeed doesn't support Nginx directives. You will need to convert to apache format.
4. You can convert it to rewrite rule instead of redirect directive.
 
#5
Use Javascript:

window.location.replace('http://example.com');

It’s better than using window.location.href = ‘http://example.com’;

Using replace() is better because it does not keep the originating page in the session history, meaning the user won’t get stuck in a never-ending back-button fiasco.

If you want to simulate someone clicking on a link, use window.location.href

If you want to simulate an HTTP redirect, use window.location.replace

You can use assign() and replace methods also to javascript redirect to other pages like the following:

location.assign("http://example.com");

The difference between replace() method and assign() method(), is that replace() removes the URL of the current document from the document history, means it is not possible to use the “back” button to navigate back to the original document. So Use the assign() method if you want to load a new document, and want to give the option to navigate back to the original document.
 
Top