1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

.shtml / .html or .php

Discussion in 'HTML & Website Design' started by leeds1, Sep 14, 2004.

  1. #1
    Hi

    My main site is written in static html and I want to change to have server includes. I have already done this on another site and it works really well.

    My questions:

    1: Is it better to name the page .php or .shtml or what (you can tell I am new to this !) .shtml works well with the .php includes I have on another site

    2: If I convert all my static pages from page.html to page.shtml how do I undertake all the re-directs ?

    Thanks
     
    leeds1, Sep 14, 2004 IP
  2. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #2
    In case you are interested, there are ways to effectively "strip" file extensions so that you can change technology [.shtml, .php, etc.] without having to worry about future redirects.

    I am on an Apache Server and simply enable "MultiViews." It's that easy.
     
    ResaleBroker, Sep 14, 2004 IP
  3. leeds1

    leeds1 Peon

    Messages:
    585
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    cool - I am on cpanelx - what should I look at?

    There's a place called "apache handlers" but I need to type things in

    Any ideas ?
     
    leeds1, Sep 14, 2004 IP
  4. leeds1

    leeds1 Peon

    Messages:
    585
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    OK, I've added "Options +MultiViews" into my .htaccess file and a filename "page" will revert to the real filename "page.shtml"

    If I type in page.html it returns a 404 which is no good because all my inbound links are to page.html and the pages in google are page.html

    Any suggestions ?
     
    leeds1, Sep 14, 2004 IP
  5. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #5
    I'm not familiar with cpanelx. You might not have to make any configurations other than to your .htaccess file.

    To enable "MultiViews" you place the code in your .htaccess file as shown below:

    RewriteEngine on
    Options +MultiViews​

    Once you have done this now all you have to do is leave off the extensions in your hyperlinks. For instance:

    Instead of -- http://www.mydomain.com/page.html
    Use --http://www.mydomain.com/page

    To see this in action visit my site.
     
    ResaleBroker, Sep 14, 2004 IP
  6. leeds1

    leeds1 Peon

    Messages:
    585
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Done that and it works great

    BUT

    If someone links to me with extension .html (as all my links for the last 3 years) it's going to go to a 404

    How do I redirect to all the new pages ?
     
    leeds1, Sep 14, 2004 IP
  7. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #7
    A mod_rewrite would handle all of the redirects. Of course these would be 301 redirects. Not that it matters but how many redirects are you talking about?
     
    ResaleBroker, Sep 14, 2004 IP
  8. leeds1

    leeds1 Peon

    Messages:
    585
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #8
    About 130 pages

    All will redirect from page.html to page.shtml

    Is there a wildcard I can use ?
     
    leeds1, Sep 14, 2004 IP
  9. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #9
    These redirects should be a snap with mod_rewrite.

    I am on my way out. Check around on the forum. When I get back if you don't have the script I'll check into it for you.
     
    ResaleBroker, Sep 14, 2004 IP
  10. Will.Spencer

    Will.Spencer NetBuilder

    Messages:
    14,789
    Likes Received:
    1,040
    Best Answers:
    0
    Trophy Points:
    375
    #10
    If you have access to your httpd.conf (and perhaps even through CPanelX), you can enable Shared HTML with the .HTML extension.

    Google has been, IMHO, non-performing in it's claim to transfer PR/Relevancy through 301 Redirects.

    It is best never to change page names unless absolutely necessary.
     
    Will.Spencer, Sep 14, 2004 IP
  11. leeds1

    leeds1 Peon

    Messages:
    585
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I've no idea what this means - what would I need to do so that anyone trying to execute page.html actually executes page.shtml and the latter shows up in Google


    I know - but needs must..
     
    leeds1, Sep 14, 2004 IP
  12. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #12
    if the only reason you have is to have SSI in your HTML files
    then there is NO NEED to change file extension AT ALL !!!

    just add in your .htaccess

    AddHandler server-parsed htm
    AddHandler server-parsed html

    i guess you could also write it on one line

    AddHandler server-parsed htm html

    may be there is even a smarter way using wildcard ?

    and your done !! apache will correctly include any SSI from now on

    i use it on my own site ;-) since long time

    i have however NOT been able to include PHP that way
    using
    AddType x-mapp-php4 .html .htm

    recently and then going away for half a day ...
    i had half a day WIN IE surfers being disabled to see my HTML content - only mozilla / netscape users had full access -
    so i could NOT include via PHP ( it was an attempt to include RSS newsfeed into an HTML page )

    for SSI - zero problem as above !
    with one exception all my RSS newsfeed are inserted via SSI into my htm/html pages ! - see my domain / as an example
     
    hans, Sep 14, 2004 IP
  13. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #13
    Have you already resolved this issue? If not, bear in mind that the .htaccess redirects are for the directory the .htaccess file is located in. So, are the pages you want to redirect all in one directory or are they scattered throughout?
     
    ResaleBroker, Sep 14, 2004 IP