I just port my site from asp to opencart. In .htaccess, I would like to do some redirects so that my client can use the old link to access
inside .htaccess
redirect 301 /contact.asp http://www.example.com/index.php?route=information/contact_us redirect 301 /downloads.asp http://www.example.com/downloads
For contacting us, which work fine, however, for the download URLs, this did not work. when I access http://www.example.com/downloads.asp , it redirects to http://www.example.com/downloads?_route_=downloads.asp and Opencart show that the page was not found. For http://www.example.com/downloads we have set a friendly SEO URL in the backend system.
We have access to
http://www.example.com/information/downloads
http://www.example.com/downloads
but we cannot access with a normal link
http://www.example.com/index.php?route=information/downloads
Next up is my full .htaccess
# Prevent Direct Access to files <FilesMatch "\.(tpl|ini)"> Order deny,allow Deny from all </FilesMatch> # SEO URL Settings RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] redirect 301 /contact.asp http://www.example.com/index.php?route=information/contact_us redirect 301 /downloads.asp http://www.example.com/downloads
============= OTHER TESTS =========================
I checked this on my local host, I found out that this is a great result. However, my problem is still not resolved.
I am running .htaccess from http: // localhost / example and http: // example (virtual directory added)
For http: // localhost / example
redirect 301 /example/downloads.asp http://localhost/example/downloads/
and
For http: // example
redirect 301 /downloads.asp http://example/downloads/
Then I tried to redirect the link to my version in real time, with localhost (http: // example)
redirect 301 /downloads.asp http://www.example.com/downloads/
I refer to http: //example/downloads.asp
The browser redirects me
http://www.example.com/downloads?route=downloads.asp
FAVORITE
In the LIVE version, I did not add a redirection code [VERY SURE FOR THIS]
But in the live version, I get access directly with enter
http://www.example.com/downloads
I'm not sure why the localhost redirect 301 will be released in the live version
http://www.example.com/downloads?route=downloads.asp
Any idea?