There are a lot of ways to do this. Out of curiosity try this code
instead. I’ve used it (or a variation of) on many sites without issue.
Perhaps it will work for you. Btw, are you sure mod_rewrite is enabled
on your server?
#Removes file extension
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^([^/]+)/$ $1.html
# Forces a trailing slash to be added
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
I replaced the code with the code above, and no luck. Do I need to replace the “domain” with mine and “.name” with .com? I didn’t replace the previous code with anything either.
Or you could you this Javascript code embedded into your HTML page.
Ctrl+click in page, select HTML Markup…
Paste the code below.
Change 150*60 to alter the setTimeout for the page to redirect.
~~
~~
Works on all Browsers and platforms for me.
Adrian
On 4 Aug 2010, at 08:09, rebeccintosh wrote:
I found some code that works! Here it is, should anyone else need it.
––––
Options +FollowSymLinks
RewriteEngine On
redirect index.htm and index.html to / (do this before non-www to www)
A JavaScript redirect will work, but it is NOT particularly good in
search engine optimisation (SEO) terms. In fact, it could even have a
negative impact on your site’s SEO.
JavaScript redirects are used to take a page away from someone after
they’ve arrived. This could be used for ‘black hat’ SEO efforts,
trying to set up different pages for search engines and human
visitors and bouncing people to something that’s not what the
(JavaScript-ignoring) search engine spiders see.
Because of this, spiders look for precisley this kind of behaviour
and consider it a possible warning flag.
Server-level redirects, however, are legitimate, instant, and happen
to every visitor regardless of JavaScript capabilities. The
redirection is done before any page content is returned, and the
301 status code is included to tell anything that’s paying attention
that the redirection is permanent. Search engine spiders like this
kind of no-messing, even-handed, standards-respecting redirection.
See Using htaccess for efficient redirection of visitors for some
info on achieving this using a simple .htaccess file.
That’s not to say the JavaScript method shouldn’t ever be used, but
it is important to consider the possible SEO implications. If you do
want to do that way there is a Freeway action that makes it even
simpler than copying and pasting code. Look for Timed Redirect in the
Page actions. (I think this is a standard action - otherwise look
on actionsforge.com)