Forum Moderators: martinibuster

Message Too Old, No Replies

preserving links home page

         

pokerbull

11:39 pm on Jun 1, 2006 (gmt 0)

10+ Year Member



I am changing my home page from index.html to index.php. However, I have many links that point to index.html. What's the best way to preserve the link power from these links? If I do some sort of redirect, will the search engines transfer the link power from the .html page to the .php page? Thanks.

jonrichd

11:48 pm on Jun 1, 2006 (gmt 0)

10+ Year Member



If you're on an apache server, put an entry in your .htaccess file that says

RewriteRule /index.html /index.php [L]

That rule says, whenever someone requests index.html, serve index.php, but don't make the switch in files visible to the browser.

Then continue using index.html in all of your on-site links. Don't switch to index.php, or you could run into duplicate content issues.

There's more good info on URL rewriting here [webmasterworld.com].

sugarrae

3:37 pm on Jun 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'd suggest redirecting to the / --- i.e. http:*//www.yourdomain.com/ (remove the star of course) so that no matter what format you use for the index page, the links are all going to the root.

pokerbull

4:15 pm on Jun 2, 2006 (gmt 0)

10+ Year Member



Thanks for both of your help. Does it matter if I include the trailing slash on [*mydomain.com...] I sometimes have these on some of my incoming links, and sometimes not. Does it affect anything?

jatar_k

4:16 pm on Jun 2, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



why not just have the html extension parsed for php, the you don't need to change the extension at all

pokerbull

4:55 pm on Jun 2, 2006 (gmt 0)

10+ Year Member



I tried the parsing method. When I seached google for the commands to do this in htaccess, I got two different ways:

one site recommended this command:
AddHandler cgi-script .html

another site recommended this commmand:
AddType application/x-httpd-php .php .html

Does anyone know which of the above is correct for parsing html as php?

jatar_k

5:01 pm on Jun 2, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the AddType should be fine

there are tons of thread around about it [google.com]