Reputation: 7520
I am using opencart in my ecommerce. And I want to setup an htaccess that will redirect to the admin panel.
Here's my current setup for the htaccess:
RedirectMatch 302 .* http://localhost/dev_beta/flaxcms/admin/
I want to redirect
http://localhost/dev_beta/flaxcms
To
http://localhost/dev_beta/flaxcms/admin/
Can you help me about this? Or if Opencart related is there a way so that only the admin panel is accessible and not the store front end?
Ok thats all I hope you can help me. Thanks.
Ok I update my index.php and I think my code for this is kinda dirty but it solves my issue:
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if($actual_link == 'http://localhost/dev_beta/flaxcms/') {
header('Location: http://localhost/dev_beta/flaxcms/admin');
exit;
}
I don't think that it is a good idea.
Upvotes: 0
Views: 47
Reputation: 786081
Create a dev_beta/.htaccess
if it doesn't exist and place this rule:
RewriteEngine On
RewriteRule ^flaxcms/?$ /dev_beta/flaxcms/admin/ [L,NC,R=302]
You must clear your browser cache before testing this change.
Upvotes: 1
Reputation: 3520
Please try:
RewriteEngine on
Redirect 302 /dev_beta/flaxcms$ http://localhost/dev_beta/flaxcms/admin/
Upvotes: 1