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.
Stumble it!
December 16th, 2010 at 10:02 pm
yay that’s exactly what I was looking for to resolve a different problem
August 16th, 2011 at 7:21 pm
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
January 10th, 2012 at 9:04 pm
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!
March 14th, 2012 at 2:09 pm
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??
March 14th, 2012 at 2:42 pm
Current path to web is
http://www.escudes.co.uk/www.web.me.com_Escudes/Welcome.html
need it ot appear has
http://www.escudes.co.uk/Welcome.html
please help with .htaccess
March 14th, 2012 at 8:37 pm
Just hit your site (http://escudes.co.uk) and it looks like you’ve got it working to me …
April 21st, 2012 at 7:31 pm
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!
April 23rd, 2012 at 5:35 am
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!
June 4th, 2012 at 3:35 pm
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
June 4th, 2012 at 10:44 pm
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]
January 23rd, 2013 at 2:28 am
Worked like a charm!
**Make sure you pay attention to your folder names, they are case sensitive