.htaccess file help


(Bruce Kieffer) #1

Can you help me troubleshoot this htaccess file? Bluehost is my host. They say I can “host the Primary Domain from a subfolder (.htaccess),” and I thought I had set that up correctly, but it does not work, and BH is unable to help me fix it. My domain is kieffer.us. It should open that site, but it goes to a directory instead. Here’s their info:
https://my.bluehost.com/cgi/help/347

And here’s what my .htaccess text file looks like (thanks RW for adding this to RW8!).


(MRO) #2

Seems to me your RewriteRule is the Problem. Shouldn’t be /index.html…

Maybe try something like this:

RewriteRule ^(.*)$ https://kieffer.us/$1 [R,L]

…and a suggestion for your RewriteCond:

RewriteCond %{HTTP_HOST} kieffer.us [NC]


(Bruce Kieffer) #3

Thanks Marc. Got it working. I used an old file that worked before and I changed the names to the new names. I think you understand. Here’s the text:

Use PHP5.6 as default

AddHandler application/x-httpd-php56 .php

BlueHost.com

.htaccess main domain to subdirectory redirect

Do not change this line.

RewriteEngine on

Change example.com to be your main domain.

RewriteCond %{HTTP_HOST} ^(www.)?kieffer.us$

Change ‘subdirectory’ to be the directory you will use for your main domain.

RewriteCond %{REQUEST_URI} !^/kieffer/

Don’t change the following two lines.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Change ‘subdirectory’ to be the directory you will use for your main domain.

RewriteRule ^(.*)$ /kieffer/$1

Change example.com to be your main domain again.

Change ‘subdirectory’ to be the directory you will use for your main domain

followed by / then the main file for your site, index.php, index.html, etc.

RewriteCond %{HTTP_HOST} ^(www.)?kieffer.us$
RewriteRule ^(/)?$ kieffer/index.html [L]


(system) #4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.