Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other 301 redirects or mod_rewrite extension better for SEO?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #35028
    standuncan
    Member

    I’m transferring an old site to a new design/structure. It was html, now php. So to maintain the SEO and for incoming links which would be a better solution?



    Options +FollowSymlinks
    RewriteEngine on
    RewriteCond %{DOCUMENT_ROOT}/$1.php -f
    RewriteRule ^(([^/]+/)*[^.]+)$ /$1.php [L]

    redirect 301 /index.html http://www.domain.com/index
    redirect 301 /about.html http://www.domain.com/about



    Options +FollowSymlinks
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*).html$ /$1.php [L,QSA]

    #90135
    TheDoc
    Member

    Definitely will want to use the 301 redirects if you are moving a domain. As for the mod_rewrite stuff, I’m a little out of my element there.

    You’ll also want to set up a domain forwarding from your domain control panel.

    #90137
    standuncan
    Member

    I think you misunderstood or maybe I did not explain it correct, the domain is staying the same. I’m just switching to an updated design/php structure.

    Basically if all the pages are named the same (they are), and I rewrite the extension to read .html, I won’t need redirects because they all appear as .html pages even though they are actually php pages. (in other words if you click an old link posted somewhere that has the URL “http://www.example.com/about.html” it will now take you to “http://www.example.com/about.html”; however what you are really viewing is:http://www.example.com/about.php”)

    Otherwise, I can remove the php extension and then use redirects to redirect to the new pages…

    #90204
    standuncan
    Member

    Anyone have any ideas if one way is better than the other?

    #90280
    TheDoc
    Member

    Aaahhh I see. Well then I’m CERTAINLY out of my element! Sorry!

    #90307
    standuncan
    Member

    No worries, thanks for trying :)

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Other’ is closed to new topics and replies.