Post by Didoo » Wed Sep 12, 2018 9:51 pm

Hello,

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
to this url :

Code: Select all

https://opencart.oc/admin/products&user_token=XXXXXXXXXX
I actually tried few methods to do it :

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]
Method #2. With .htacess inside the admin folder :

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]
Method #3. With apache vhost

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>
But these methods was unsuccessful.

Help would be much appreciated.

Thank you

Newbie

Posts

Joined
Thu Aug 09, 2018 12:57 am
Who is online

Users browsing this forum: No registered users and 3 guests