Recently, I transferred an Opencart webshop from one server to another server. After Transferring the project I had some pages to redirect . I tried many times in .htaccess. the code that I used to do this is bellow:
But I failed, it did not work properly. I had another suggestion from forum site and that was as follows:
The Code I used to redirect is here by the name of old page:
Thanks for your reading. Never forget to comment bellow.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
Redirect 301 /onepage.htm http://mt-example.com/mynewpage
But I failed, it did not work properly. I had another suggestion from forum site and that was as follows:
RewriteCond %{HTTP_HOST} ^www.example.com/oldpage.html [NC]But yet I failed to redirect properly. Finally paused the work for another day and fresh thinking on how I can do it easily . Thinking....thinking.... thinking... Finally , I got an idea my own that I will redirect these pages very simply. wow! that was a nice idea and very simple. I just created some pages by the name of old pages with the following code and upload them on the root directory and it worked excellent.
RewriteRule ^(.*)$ http://example.net/mynewpage/$1 [L,R=301,NC]
The Code I used to redirect is here by the name of old page:
<!DOCTYPE html>Here the URL is to redirect new page and it works nice.
<html>
<meta http-equiv="refresh" content="0; URL=http://www.mydomain.com/newpage">
<head>
<title>title of old page </title>
</head>
<body>
</body>
</html>
Thanks for your reading. Never forget to comment bellow.
No comments:
Post a Comment