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.
Solved! Go to Solution.
Hello 🙂
You can do it using these commands in .htaccess file 🙂
RewriteEngine on RewriteCond %{HTTP_HOST} ^yourdomain\.com$ RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L] RewriteRule ^$ subdomainname[L]
If this helped you 🙂 mark this topic as solved !
Sincerely,
PremtonX
Community Contributor
Hello 🙂
You can do it using these commands in .htaccess file 🙂
RewriteEngine on RewriteCond %{HTTP_HOST} ^yourdomain\.com$ RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L] RewriteRule ^$ subdomainname[L]
If this helped you 🙂 mark this topic as solved !
Sincerely,
PremtonX
Community Contributor