# .htaccess file help

**URL:** <https://forums.realmacsoftware.com/t/htaccess-file-help/22490>\
**Category:** RapidWeaver Classic\
**Created:** [September 25, 2018, 1:47pm UTC](https://forums.realmacsoftware.com/t/htaccess-file-help/22490 "2018-09-25T13:47:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruce](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bruce/32/23155_2.png) [@bruce](https://forums.realmacsoftware.com/u/bruce)\
**Post date:** [September 25, 2018, 1:47pm UTC](https://forums.realmacsoftware.com/t/htaccess-file-help/22490/1 "2018-09-25T13:47:19Z")

</div>

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](http://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](https://my.bluehost.com/cgi/help/347)

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

 ![58%20AM](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/2X/1/17b01adaa468a71371b07a020cafae1b06f24036.jpeg)

---

<div class="post-metadata">

**Author:** ![Basswow](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/basswow/32/12589_2.png) [@Basswow](https://forums.realmacsoftware.com/u/Basswow)\
**Post date:** [September 25, 2018, 6:58pm UTC](https://forums.realmacsoftware.com/t/htaccess-file-help/22490/2 "2018-09-25T18:58:01Z")

</div>

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

Maybe try something like this:

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

…and a suggestion for your RewriteCond:

RewriteCond %{HTTP\_HOST} [kieffer.us](http://kieffer.us) [NC]

---

<div class="post-metadata">

**Author:** ![bruce](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/bruce/32/23155_2.png) [@bruce](https://forums.realmacsoftware.com/u/bruce)\
**Post date:** [September 26, 2018, 12:06am UTC](https://forums.realmacsoftware.com/t/htaccess-file-help/22490/3 "2018-09-26T00:06:17Z")

</div>

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](http://BlueHost.com)

# .htaccess main domain to subdirectory redirect

# Do not change this line.

RewriteEngine on

# Change [example.com](http://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](http://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]

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/system/32/25301_2.png) [@system](https://forums.realmacsoftware.com/u/system)\
**Post date:** [October 26, 2018, 10:06am UTC](https://forums.realmacsoftware.com/t/htaccess-file-help/22490/4 "2018-10-26T10:06:31Z")

</div>

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