- 301 Redirects Problem; redirecting index.html to domain name
- Posted by David on August 13th, 2005
Has anyone had a problem with 301 redirecting (via .htaccess file)
something like
www.example.com/index.html to www.example.com/
Where index.html is (or one of) the default home page (DirectoryIndex
index.html)?
Used a lot of 301s and this is the first time I've tried this and it
seems to put the browser into a loop!
Other than the obvious of change the default home page from index.html
to something else and remove index.html from DirectoryIndex is there a
solution?
BTW the .htaccess file format is fine-
Redirect 301 /index.html http://www.example.com/
David
--
Free Search Engine Optimization Tutorial
http://www.seo-gold.com/tutorial/
- Posted by Paul Burke on August 13th, 2005
On Sat, 13 Aug 2005 17:26:53 GMT, David
<seodave@search-engine-optimization-services.co.uk> wrote:
Are you on an Apache or Windows server ?
I know that it will go in a loop on a windows server.
hth
plh
Paul
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
- Posted by Borek on August 13th, 2005
On Sat, 13 Aug 2005 19:26:53 +0200, David
<seodave@search-engine-optimization-services.co.uk> wrote:
Either I don't understand what you are trying to achieve or
you are trying impossible and it must end with endless loop.
If index.html is default, www.example.com/ is redirected to
www.example.com/index.html, which you want to redirect back
to www.example.com/ - loop closes here...
Best,
Borek
--
http://www.chembuddy.com - chemical calculators for labs and education
BATE - program for pH calculations
CASC - Concentration and Solution Calculator
pH lectures - guide to hand pH calculation with examples
- Posted by Tony on August 13th, 2005
David wrote:
Can you post your servers list of file names - in their order of priority
For example:
index.html
home.html
index.htm
welcome.html
default.htm
index.php
Also, can you be a little more specific about what you are trying to
achieve (need more info).
Reading between the lines, I'd say that you are presently redirecting to
"/" which then triggers another request to index.html, which then causes
the loop you are experiencing.
- Posted by David on August 14th, 2005
On Sat, 13 Aug 2005 12:40:53 -0500, Paul Burke
<webmaster@houstoncrafts.com> wrote:
Apache.
After thinking about it I can understand why it does this, to the
server they are the same page, though it doesn't feel like the
smartest way to have this work.
After even more thought realised the obvious solution I included
should cover all realistic eventualities since you can rename your
index page and so redirect any page you like.
Just means to do this you have to rename your index page. Bit of a
pain if it's someone elses fault you have the index page indexed twice
(a webmaster linking to index.html for example even when you don't).
David
--
Free Search Engine Optimization Tutorial
http://www.seo-gold.com/tutorial/
- Posted by David on August 14th, 2005
On Sat, 13 Aug 2005 19:06:37 GMT, Tony <spamkill@nospam.net> wrote:
Was
index.html
index.php
index.asp
For the site I was dealing with have removed index.html from the list
and added index.htm, renamed the file index.html to index.htm and
setup a 301 to redirect index.html to / (this works).
Redirect www.example.com/index.html to www.example.com/ (or /) without
having to rename the index file.
If you have a situation where you've got links to both
www.example.com/index.html and
www.example.com/
both can be indexed in search engines (findable with specific
searches) potentially causing the loss of benefit to the page as a
whole.
So I want to be able to 301 redirect the former to the latter without
renaming the default index page (renaming it does work).
Although this is mostly academic now there is still the potential for
a webmaster to link to the newly named index page and cause the
problem again. Unlikely, since after doing this you wouldn't link to
the new index page directly (so no one will know the new name).
Still I'd like to know if there is a solution without having to rename
the index page and remove the old name (the redirected one) from the
list of pages the server will accept as a index page.
Specifically redirecting to www.example.com/ (which I assume is what
you meant) and yes it does cause a loop. Weird way to deal with a
redirect like this since it causes the potential problem I mention
above. Also prevents you from forcing www.example.com/ to load (via a
301) when accessing www.example.com/index.html.
David
--
Free Search Engine Optimization Tutorial
http://www.seo-gold.com/tutorial/
- Posted by Sam on August 14th, 2005
So far only getting a network error popup message. You need to rty
harder I'm sure it will come to you.
- Posted by Tony on August 14th, 2005
David wrote:
This should redirect all requests to example.com (including index.html)
to example.com/index.htm
In .htaccess in domain root:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
RewriteRule ^$ http://www.example.com/index.htm [R=301,L]
#Result:
#HTTP/1.x 301 Moved Permanently
#Transfer-Encoding: chunked
#Date: Sun, 14 Aug 2005 10:55:53 GMT
#Content-Type: text/html; charset=iso-8859-1
#Server: Apache/1.3.33 (Unix)
#Location: http://www.example.com/index.htm


