cancel
Showing results for 
Search instead for 
Did you mean: 
Go to solution

htaccess redirect to folder with error

I tried to use the htaccess file to redirect to a specific folder where my site is.  I am using Business Shared Hosting with goDaddy. 

 

Changes in .htaccess file:


RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?domain.care$
RewriteCond %{REQUEST_URI} !^/(folder_name)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ /(folder_directory)/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^(www.)?(SITE_URL)$
RewriteRule ^(/)?$Directory_index.php [L]

 

After I redirected or tried I got an error:  This website is temporarily unavailable, please try again later. I changed it back to the original .htacces file, however, the error message is still there.

 

How can I solve the problem, and most importantly, the problem of redirecting it to the specific folder for my site to function?

 

Thanks.

1 REPLY 1
Highlighted
Resolver II
Solution

Re: htaccess redirect to folder with error

Hello Smiley Happy

You can do it using these commands in .htaccess file Smiley Happy

RewriteEngine on
RewriteCond %{HTTP_HOST} ^yourdomain\.com$
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
RewriteRule ^$ subdomainname[L] 

 

If this helped you Smiley Happy mark this topic as solved !

 

Sincerely,

PremtonX

Community Contributor