I want to know if it's there a way to rewrite the admin url as it works for the catalog.
For example rewrite this url :
Code: Select all
https://opencart.oc/admin/index.php?route=catalog/product&user_token=XXXXXXXXXX
Code: Select all
https://opencart.oc/admin/products&user_token=XXXXXXXXXX
Method #1. With .htacess at the root folder by adding :
Code: Select all
RewriteBase /admin
RewriteRule ^admin/user_token\=([a-zA-Z0-9_-]+)$ /index.php?route=catalog/product&user_token=$1 [L]
Code: Select all
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^admin/\product/\user_token\=(.*)$ /index.php?route= catalog/product&user_token=$1 [L]
RewriteRule ^admin/\filter/\user_token\=(.*)$ /index.php?route= catalog/filter&user_token=$1 [L]
Code: Select all
<IfModule mod_rewrite.c>
RewriteCond %{QUERY_STRING} ^(.*)&route=([0-9]{10,12})(?:&)(.*)$
RewriteRule ^(.*)$ https://%{SERVER_NAME}/admin/$1?%1/%2\?%3 [NE,L,R]
</IfModule>
Help would be much appreciated.
Thank you