what a difference htaccess makes!

9 views
Skip to first unread message

TheBicyclingGuitarist

unread,
Jul 18, 2010, 1:03:56 AM7/18/10
to Only Validation + Navigation = Crawlability
I've spent ten years steadily improving the code of my web site's HTML
and CSS. Recently I redid some of the older legacy pages to get rid of
tables used for layout. So my site has had valid code for a while even
if some of it was clumsily written or implemented. The biggest single
improvement in performance though came just a couple days ago when I
finally enabled file compression and browser caching. Wow.

Now I need help with redirecting the index files of folders to their
respective roots, that is, instead of ../foo/index.htm and ../foo/ (no
filename) both being listed by Google's webmaster tools with
consequent reporting of duplicate content, I want only the root to be
listed (no filename).

I copied the canonicalization htaccess thingie provided here to my
htaccess. It includes redirects for different file names to the root
but only for the home page of the web site so far as I know. How do I
give directives for that to happen for the index files of sub-folders
and sub-sub folders? All my HTML pages have the three-digit .htm
extension (I started in DOS days).

webado

unread,
Jul 18, 2010, 1:22:47 AM7/18/10
to Only Validation + Navigation = Crawlability
Actually that should redirect to the root of the folder, not merely
the root of the site.
It may happen that for some Apache server this fails.
But try it first and see.



On Jul 18, 1:03 am, TheBicyclingGuitarist

TheBicyclingGuitarist

unread,
Jul 18, 2010, 2:34:00 AM7/18/10
to Only Validation + Navigation = Crawlability


On Jul 17, 10:22 pm, webado <web...@gmail.com> wrote:
> Actually that should redirect to the root of the folder, not merely
> the root of the site.
> It may happen that for some Apache server this fails.
> But try it first and see.
>

I just tested by typing in default.html for my studies folder (no file
by that name exists). Sure enough, it DID redirect to the root of that
folder (loading the index.htm file but not showing the filename after
the trailing slash of the directory name). Yay!

Thanks
Reply all
Reply to author
Forward
0 new messages