I know this question is more about apache config, but it involves Magento too. Currently i have configured my Magento with 2 different URLs,

for port 443 or https I have an url like this: https://subdomain.domain.org/

for http i have: http://subdomain.domain.org/folder

I want to redirect whenever a user types subdomain.domain.org to https://subdomain.domain.org, but if i do this my admin panel redirects there too, i have tried RewriteCond but no one of them worked, my admin panel url is: http://subdomain.domain.org/folder/admin , this link should not be redirected.

Can someone help me to figure out how to do this?

Thank you!


Please check with below posibilities :

check with your .htaccess ( url rewrite )

check your admin base url.

i.e htaccess :

Options +FollowSymLinks  #Include this line if you are using Godaddy hosting
RewriteEngine On
RewriteCond %{REQUEST_URI} !(.*)subfolder
RewriteRule ^(.*)$ subfolder/$1 [L]

another option :

goto database core_cofig table

path - admin/url/use_custom set value 0

path - admin/url/use_custom_path set value 0

I hope its very helpful to you

| improve this answer | |
  • Hello, I don't know what i'm doing wrong but this does not work, I put the rule at the end of mod_rewrite. – Oscar Vazquez Jul 30 '19 at 13:27
  • please check my answer, i updated, one more possibility.., than please flush cache. – Anas Mansuri Jul 30 '19 at 13:38
  • its working for my side. – Anas Mansuri Jul 30 '19 at 13:45
  • Hello, at the end I used this rule and it worked: RedirectMatch permanent "^(/(?!folder/?).*)" subdomain.domain.org/$1 ,I really appreciate your help. – Oscar Vazquez Jul 30 '19 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.