switching index.html to index.php 
Author Message
 switching index.html to index.php

I have a long standing site (my personal site - below) that I'd like
to switch over to php generated pages.

Having been around a long time, I imagine that a lot of people have
bookmarked (or linked to) my index.html page.

I'd like to change the default page to index.php, but also provide a
smooth transition for people who try to access index.html.

I could simply use a 404 page (too crude), an instant redirect (nearly
invisible), or a delayed redirect with a message about replacing the
old bookmark.

..... or .....  an htaccess solution?

Any suggestions or opinions about the "slickest " way to do this?

--
**********************************************
 Chuck Anderson ? Boulder, CO    CycleTourist at
  http://www.*-*-*.com/           attbi.com
 Tolerance is recognizing that other people have different ideals
 and needs than you. Compromise is acting on that knowledge.
***********************************************************



Tue, 14 Jun 2005 04:57:00 GMT  
 switching index.html to index.php

[...]

Quote:
> I'd like to change the default page to index.php, but also provide a
> smooth transition for people who try to access index.html.

[...]

Quote:
> ..... or .....  an htaccess solution?

.htaccess is your friend. Put the following line in your .htacces:

Redirect permanent /index.html http://www.*-*-*.com/

--

      "One's never alone with a {*filter*} duck."



Tue, 14 Jun 2005 05:05:32 GMT  
 switching index.html to index.php

Quote:


> > I'd like to change the default page to index.php, but also provide a
> > smooth transition for people who try to access index.html.

> > ..... or .....  an htaccess solution?

> .htaccess is your friend. Put the following line in your .htacces:

> Redirect permanent /index.html http://yourdomain.com/index.php

That's perfect.  No redirect.

Thanks a lot.

--
**********************************************
 Chuck Anderson ? Boulder, CO    CycleTourist at
 http://www.CycleTourist.com           attbi.com
 Tolerance is recognizing that other people have different ideals
 and needs than you. Compromise is acting on that knowledge.
***********************************************************



Tue, 14 Jun 2005 09:31:44 GMT  
 switching index.html to index.php

Quote:

> I have a long standing site (my personal site - below) that I'd like to
> switch over to php generated pages.

> Having been around a long time, I imagine that a lot of people have
> bookmarked (or linked to) my index.html page.

> I'd like to change the default page to index.php, but also provide a
> smooth transition for people who try to access index.html.

Use an error page that will work out what page they were looking for .htm
.html and redirect them to .php example below (.htaccess bit is for
Apache)

first file:
.htaccess

ErrorDocument 404 /404.php

From my prefered 404.php page:

$period = strrpos( $_SERVER['REQUEST_URI'], '.');
$slash = strpos( $_SERVER['REQUEST_URI'], '/' );
if( $period > $slash ) {
        $page = substr( $_SERVER['REQUEST_URI'], ($slash +1), ($period -1) );

Quote:
} else {

        $page = substr( $_SERVER['REQUEST_URI'], $slash +1 );
Quote:
}

if( file_exists( $page.".php" ) && $page != "404" ) {
        header( "Location: http://".$_SERVER['HTTP_HOST']."/".$page.".php" );
Quote:
} else {

        header( "HTTP/1.1 404 File Not Found" );

Quote:
}

echo what ever hilarious comment you come up with ;0)

Hell you can do all sorts... like feed it into a search like
http://www.php.net does (I really think that is brilliant)



Tue, 14 Jun 2005 09:41:47 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ANNOUNCE: IndexMaker 6.7: an index.html maker from PDF,HTML,VRML and other files

2. ANNOUNCE: IndexMaker 6.6: an index.html maker from PDF,HTML,VRML and other files

3. ANNOUNCE: IndexMaker 6.5: an index.html maker from PDF,HTML,VRML and other files

4. ANNOUNCE: IndexMaker 6.1: an index.html maker from PDF,HTML,VRML and other files

5. ANNOUNCE: IndexMaker 6.0: an index.html maker from PDF,HTML,VRML and other files

6. ANNOUNCE: IndexMaker 5.3: an index.html maker from PDF,HTML,VRML and other files

7. ANNOUNCE: IndexMaker 5.2: an index.html maker from PDF,HTML,VRML and other files

8. ANNOUNCE: IndexMaker 5.1: an index.html maker from PDF,HTML,VRML and other files

9. ANNOUNCE: IndexMaker 5.0: an index.html maker from PDF,HTML,VRML and other files

10. ANNOUNCE: IndexMaker 4.3: an index.html maker from PDF,HTML,VRML and other files

11. ANNOUNCE: IndexMaker 4.1: an index.html maker from PDF,HTML,VRML and other files

12. ANNOUNCE: IndexMaker 4.2: an index.html maker from PDF,HTML,VRML and other files

 

 
Powered by phpBB® Forum Software