Welcome to WebmasterWorld Guest from 3.80.6.254

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

rewriting index page to document root

     
12:12 am on Jan 20, 2004 (gmt 0)

New User

10+ Year Member

joined:Dec 9, 2003
posts:35
votes: 0


I would like maintain my url structure and rewrite requests like:

[domain.com...] or
[domain.com...] to
[domain.com...]

I don't need help with "search engine friendly urls", as I already have a good system in place. As of now, I have a good slash-forward system and any requests for [domain.com...] get rewritten to [domain.com...]

Try these urls:
[alistapart.com...]
[alistapart.com...]

That's what I mean. I know it'd be something like:

RewriteRule ^index\.html$ / [L]

But all I get is server errors. It's weird, I can figure out really complex slash-forward things, but for this one simple rewrite for only the index page I can't seem to figure it out!

-andrew

12:25 am on Jan 20, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


compooter,

Member zorvek posted what may be the solution to your problem just last week: [webmasterworld.com...]

Jim

12:41 am on Jan 20, 2004 (gmt 0)

New User

10+ Year Member

joined:Dec 9, 2003
posts:35
votes: 0


Thanks for the link & I was hoping that would be exactly what I was looking for. Unfortunately, it seems to have no effect whatsoever when I use the solution %{ENV:SCRIPT_URL} solution. Must have something to do with my other rewrite rules' interaction with this.
1:57 am on Jan 20, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


andrew,

What server errors do you get? Are you getting 500-Server Error messages, or just the old "infinite-loop" problem?

Also, don't you want an external redirect on that? Or what's the purpose if not?

Whenever I've done this, I had to make sure that the index file - the one listed in my DirectoryIndex directive *was not* named the same as the URL I was trying to redirect. So I would rename "index.html" to "index.htm" (or anything else) put that filename into DirectoryIndex, and *then* I could externally redirect "index.html" to "/" with no problems. My purpose was to get my old and ugly www.example.com/index.html URLs removed from the search engines, so I used a 301 redirect.

Jim