Post by aarslankhan » Fri Sep 13, 2019 3:05 pm

I need some help. I have www.mysite.com in root directory. I want to run it from subfolder after redirecting from root to subfolder. For redirection, I have added RewriteRule ^$ /abc [R=301,L] in htaccess of root. I want, For example, if user enters www.mysite.com in the browser,it should redirect to www.mysite.com/subfolder without requring the user to enter www.mysite.com/subfolder in the browser. I am using OC 3.0.2.0. I have copied all files and folders from root to subfolder and have made changes in config.php, admin/config.php and htaccess of subfolder. When I enter www.mysite.com or mysite.com it redirects to mysite.com/subfolder, but gives an error "This page is not working". When I remove RewriteRule ^$ /abc [R=301,L] from htaccess of root and enter www.mysite.com/subfolder, then the page runs. But when I enter mysite.com/subfolder, then it redirects back to mysite.com and showing page of mysite.com. Do I need to redirect from non-www to www or from www to non-www as well. How can I achieve these redirections. Please advise me under which line I need to put code for redirection in htaccess of root. At the moment, I have entered it at the end of htaccess of root or after RewriteBase. Please note that I want to keep my site both in root and in subfolder. Please guide me how I can run opencart from subdirectory after redirect from root to subdirectory after keeping it both in root and subdirectory. I would be greately thankful for your great help. Thanks

New member

Posts

Joined
Tue Mar 20, 2018 3:11 pm

User avatar
Active Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - RO

Post by aarslankhan » Fri Sep 13, 2019 5:34 pm

Apologizes xxvirusxx, if you see I open multiple topics. This is because I am novice to OC. Firstly I wanted to run my www.mysite.com from www.mysite.com/subfolder without installing it in subfolder, so I asked for redirection. But could not succeed. Then I came to know it should be installed in subfolder as well. So I asked for help to move it in subfolder. New problem is that redirection is not working even after installing in subfolder and putting redirection in htaccess of root. Please could you help me out with my new topic. I would be greately thankful for your help.
Kind Regards
aarslankhan

New member

Posts

Joined
Tue Mar 20, 2018 3:11 pm

Post by xxvirusxx » Fri Sep 13, 2019 7:20 pm

Just install website in root directory (public_html)....because hackers don't give a shit if your website is in subfolder X, Y, Z...etc...

Opencart 2.3.0.2 Bugs fix added |Opencart 3.0.3.1 Bugs fix added | Opencart upgrade service


User avatar
Active Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - RO
Who is online

Users browsing this forum: No registered users and 22 guests