PHP to html modrewrite

Discussion in 'Apache' started by Blonde Jon, Sep 1, 2007.

  1. #1
    Okay, here's my situation. I have a site that is 100% html. Editing the site can be a pain. When I want to add a page, I have to add a link on every page.

    This is what I want to do. I want to make make my html pages php pages, but since my website is an established website that is getting good traffic, I want the search engines to see the .html pages instead of the php pages.

    Here are my questions:

    Will changing my html pages to PHP pages and then doing a modrewrite so that SEs see the html pages solve my problem?

    If so, how do I do a modrewrite that will solve my problem.

    I've read the sticky and it's all Chinese to me.

    Thanks!
     
    Blonde Jon, Sep 1, 2007 IP
  2. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #2
    呃,现+在说的+容易
    。哦
    等待。/
    你想^在英语布\.兰$ 妮我想你想.达英文版 [本]

    OOPS!!! I think you want da English version!!! :D:D:D:D

    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^([^.]+)\.html$ $1.php [L]
     
    Nintendo, Sep 1, 2007 IP
  3. Blonde Jon

    Blonde Jon Active Member Affiliate Manager

    Messages:
    745
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    58
    #3

    Thanks Nintendo, will this move mess up my search engine rankings?
     
    Blonde Jon, Sep 1, 2007 IP
  4. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #4
    If the site is already indexed with the php URLs, it'll generate duplicate content. mod_rewrite should be done before the search engines find you!!!
     
    Nintendo, Sep 1, 2007 IP
    Blonde Jon likes this.
  5. Blonde Jon

    Blonde Jon Active Member Affiliate Manager

    Messages:
    745
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    58
    #5
    I currently have html pages. And they are already indexed. They've actually been indexed since 2004. Man, I wish I would of started the site as a PHP site!
     
    Blonde Jon, Sep 1, 2007 IP
  6. Grumps

    Grumps Peon

    Messages:
    592
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Why dont you just change the file extension? You can still load php content in .html file and html content in .php file.
     
    Grumps, Sep 1, 2007 IP
  7. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #7
    If the URLs you link to don't change, it won't generate the duplicate content alarm.
     
    Nintendo, Sep 1, 2007 IP
  8. Blonde Jon

    Blonde Jon Active Member Affiliate Manager

    Messages:
    745
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    58
    #8
    Could you explain a little bit more? My file extensions are currently all .html. It seems like if I change them to PHP, but do a modrewrite so they appear as .html files as the same name as my old hml files the search engines wouldn't have a problem with it.?
     
    Blonde Jon, Sep 3, 2007 IP
  9. mckST

    mckST Banned

    Messages:
    159
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Correct, as long as they are the exact same files names, the search engines wont have a problem with it!

    mckST
     
    mckST, Sep 3, 2007 IP
    Blonde Jon likes this.
  10. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #10
    The search engines won't even know you're doing mod_rewrite.
     
    Nintendo, Sep 3, 2007 IP
  11. Blonde Jon

    Blonde Jon Active Member Affiliate Manager

    Messages:
    745
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    58
    #11
    Sweet! That's what I was wanting to hear for the last couple of years! :)
     
    Blonde Jon, Sep 3, 2007 IP
  12. Blonde Jon

    Blonde Jon Active Member Affiliate Manager

    Messages:
    745
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    58
    #12
    Only one problem, the modrewrite you gave me isn't working.
     
    Blonde Jon, Sep 13, 2007 IP
  13. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #13
    Do a test...

    Options +FollowSymLinks +Indexes
    RewriteEngine on
    RewriteBase /
    RewriteRule ^index\.html$ index.php [L]

    if domain.com/index.html doesn't work, nothing will work. You can try taking the first line out.
     
    Nintendo, Sep 14, 2007 IP
  14. Blonde Jon

    Blonde Jon Active Member Affiliate Manager

    Messages:
    745
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    58
    #14
    I got it figured out. Thanks Nintendo!
     
    Blonde Jon, Sep 14, 2007 IP