Reputation: 35
My friend's dad asked me to change the design of his website, so he gave me access to his account and I created a sub-folder where I uploaded the new design. The problem is that he has forgotten the password to his control panel and I only have access to the FTP in the sub-folder. I'm trying to redirect the domain (currently going to the root folder) to the sub-folder but since I don't have access to the root folder I'm finding it difficult to do so.
I've already tried a redirect with .htaccess but since I can only upload the file to my sub-folder, it thinks the redirect is to a sub-folder within that folder, instead of the folder inside the root.
TL;DR... I want to redirect 'mydomain.com' to 'mydomain.com/folder' but only have access to the FTP in 'mydomain.com/folder'.
Thanks in advance!
Upvotes: 1
Views: 76
Reputation: 1625
.htaccess applies to the directory that contains it.
You cannot change this if you have not access to vhost.conf files (what would change the base dir of the site) or to the parent directory’s .htaccess.
You will need to:
Reset your dad’s friend’s password and forget this redirect, changing the existing web files (the cleanest way), or
change the .htaccess file in your parent's dad directory, adding this:
RewriteEngine on RewriteRule ^/?(.*)$ dir2/$1 [R=301,L,P]
This should redirect the user to dir2, hiding that redirect in the urlbar.
h/t @Alejandro Teixeira Muñoz for the edits!
Upvotes: 1