/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] negative effects of changing file extension on entire site?

what kind of detrimental effects will take place to a site and their SE rankings (and any SE standings) if the entire site had all their file extensions changed from .html to .php.

And, how would we counter any ill effects if any, which I would assume, there would be since links are now not the same. That is bob.html is not bob.php.

to post a comment
SEO

7 Comments(s)

Copy linkTweet thisAlerts:
@donatelloNov 13.2009 — Your page rank would be trashed. Your HTML pages would show up as 404.

Better to simply create an .htaccess file to rewrite your pages like this:

[CODE]
AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php .php .htm .html

[/CODE]


Do this:

1.) Write the above in notepad and save it with this name: .htaccess

2.) Put it in your root directory.

Now PHP scripts will run on html pages.

No need to change all your extensions.

?
Copy linkTweet thisAlerts:
@donatelloNov 13.2009 — An added note...

If you do decide to change your whole site, you can make it so that nobody ever gets a 404 message, you can simply use .htaccess to make all dead links default to your homepage.

See this site here:

http://www.gladstonellc.com/Write-Any-Nonsense-You-Want-For-A-File

You can make up any text you want after the URL and it will always default to the homepage with a little note that the site has been updated.

Try it: http://www.gladstonellc.com/Try-It!
Copy linkTweet thisAlerts:
@etardauthorNov 13.2009 — hey thanks.. THAT is the way to go. we want to implement php includes and such and so figured the only way would be to convert all extensions to php

so, doing this htaccess trick would allow <?php include('includes/header.php') ?> to work on html pages.

UPDATE: tried it and it did not work
Copy linkTweet thisAlerts:
@donatelloNov 13.2009 — Check to see if your server supports PHP and/or that it is enabled.

Create a file named test.php.

Open the file in Notepad and type:

[CODE]< ?php phpinfo() ?>[/CODE]

After saving the file, open in your browser:

http://www.YOUR-URL/test.php

Now if you see a page with php information then you have PHP support in your Apache HTTP Server.


The .htaccess code I showed you above is the one that works for Godaddy... the standard code is this:

[CODE]addtype application/x-httpd-php .html
addtype application/x-httpd-php .htm[/CODE]

Save this as a file named simply: .htaccess

Put it in your ROOT directory.

If you have an Apache host and can enable PHP, this WILL work. Maybe you will need to find a tweak to make it work on your host, but it works.

For added help, I found this: http://php.about.com/od/advancedphp/p/html_php.htm
Copy linkTweet thisAlerts:
@etardauthorNov 13.2009 — oh yeah.. linux running php, we have other php functions running already

just so happens, this site IS on Godaddy

I did put it in the root of course

UPDATE: I found my issue.. did not tell the file to look 1 directory deeper "../"

thanks for the tip!
Copy linkTweet thisAlerts:
@donatelloNov 13.2009 — I assume that means that it works?

?
Copy linkTweet thisAlerts:
@etardauthorNov 14.2009 — 10-4, worked perfect. thanks again.
×

Success!

Help @etard spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...