How to stop iWeb putting your site in a subfolder

First of all, feel free to skip to the end for the solution. Please leave a comment if this helped you in any way (or not).

My Dad recently bought a Mac and designed a website in iWeb. When it came to publish the site I configured it and hit “publish”. Up popped a message telling me that the site was now live at “<sitename>.com/site”. Mmm I thought, I must have made a mistake when configuring it. I went back and checked the settings and found in actual fact this is “just the way it works”

Rubbish!

I Googled the situation and found that using the only way people were getting around this issue was to upload their website in an FTP client like Cyberduck. All well and good, but hardly the most tidy solution.

I decided to go about this a different way, by telling the server that instead of looking in the “www” folder as the root of the site, it should instead look inside the “site” folder.

This was achieved by creating a “.htaccess” file inside “www” (or “public_html” as it may be). You need to edit the next bit to fit your site, but you get the idea:

RewriteEngine on
#
RewriteCond %{HTTP_HOST} yoursite\.com [NC]
RewriteCond %{REQUEST_URI} !/site
RewriteRule (.*) /site/$1 [L]

Note: make sure you keep the slashes the way they are, they look odd but they are needed.
This simply tells the server to look inside the iWeb created folder whenever anyone goes to your site. Set this up once and you should be able to forget about it from then on, it just works.

I hope this helps people resolve an issue that really should not be there in the first place. Please leave a comment with your thoughts.

11 replies
  1. Simon
    Simon says:

    Hi

    I wonder if you could help by explaining this a little further to a non-techy like me?

    I have my iweb site content uploaded straight into the directory root on my server (so no site folder). So my urls are created as such: http://www.site.co.uk/page.htm

    However, my problem is that iweb wants to put the site name in the url of my rss feeds. So although my blog page is http://www.site.co.uk/blog.html iweb wants to create http://www.site.co.uk/sitename/blog.html. Therefore the rss links don’t work.

    Is there a way of putting a .htaccess file into the root of my server to tell iweb not to create rss urls with the site name? You’ll have to forgive me as this is the first time I’ve come across .htaccess and not sure how to create one

    Thanks, Simon

    Reply
  2. VertigoRay
    VertigoRay says:

    Well done. I didn’t want to hash it out myself so I did a quick Google and you saved me the time. Thanks!

    Simon. Put the .htaccess file in the root of your directory and you’ll see that it magically reworks everything for you.

    Hers’s my brother’s site that I applied this .htaccess to:
    Pretty Domain: http://ribbonsforvets.com
    Ugly iWeb Path: http://ribbonsforvets.com/Ribbons_For_Vets

    iWeb actually publishes to the “Ugly iWeb Path”, but thanks to this simple fix, you’d never be able to tell.

    Cheers!

    Reply
  3. Kev Edwards
    Kev Edwards says:

    I am being abit thick toda, but I am not sure of whta I need to place where in the htaccess file.

    This is whta I have done, but it stillshows iweb folder address.

    RewriteEngine on
    #
    RewriteCond %{HTTP_HOST} escudes\.co.uk [NC]
    RewriteCond %{REQUEST_URI} !/escudes.co.uk
    RewriteRule (.*) /escudes.co.uk/$1 [L]

    Please advise what I am I doing wrong??

    Reply
  4. Luis
    Luis says:

    This looks like what I’m looking for… unfortunately, I’m a beginner:

    1) How do I create a “.htaccess” file? Do I simply change the suffix of a “.html” file to “.htaccess”? Does it matter what I put before the “.”? (example: Will “index.htaccess” work?)

    2) If I copy and paste your bit of code above, is that all I need in the file? When I replace the red parts what is the difference between the “yoursite” and “site”? Should the “site”-part be the Ugly iWeb folder name?

    Thanks so much for figuring this out for all of us iWeb users out here!

    Reply
  5. VertigoRay
    VertigoRay says:

    1) .htaccess is the complete file name and will only work on an Apache web server. If you’re not sure if your web host is running Apache, contact them. More .htaccess info: http://bit.ly/HZpIt2

    2) Yes. Replace “site” with the ugly iWeb folder name. Replace “yoursite\.com” with your domain name. Put a backslash (\) before the periods (.) as shown in the example. If your site is luis.com your will replace “yoursite\.com” with: luis\.com

    Good luck!

    Reply
  6. fede
    fede says:

    I’m doing this for a friend.
    That worked as a charm.
    I did missed the ‘RewriteEngine on’ at the beginnig an lost like 30 minutes… 🙁
    but after I realized that I missed that it is all working perfectly

    Thank you so much
    Fede

    Reply
  7. KPM
    KPM says:

    Kev> You’re missing a backslash before your second dot:

    RewriteCond %{HTTP_HOST} escudes\.co\.uk [NC]

    Plus I would advise not to have dots in your site name. Something like escudes instead of escudes.co.uk, so that when you publish you can put:

    RewriteCond %{REQUEST_URI} !/escudes
    RewriteRule (.*) /escudes/$1 [L]

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *