Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SEO effect of switch html files to php

Featured Replies

Hi All

 

I have a website that is comprised entirely of HTML and one contact form; I'm now updating this and need to put some php code on each html page now (I'm having different contact forms) - this means I need to rename all the html extensions to PHP.

 

I started doing this and then realised this could have an effect on my SEO rankings since I have some quite high rankings on Google at the moment.

 

Possible solutions are using 301 Redirects in .htaccess, or developing an AJAX encapsulated widget on each page that can just be inserted with Javascript, or point HTML forms to one php form processing file. Does anyone have any views on this issue?

 

This is actually quite urgent and I would really love peoples views on this situation!

 

Many thanks for your time

As with everything about changing files around. There might be a little negative effect. As long as your content can be parsed by Google et al. you should be fine. One thing I wouldn't do is have php inc. files. meaning that the body the header and the footer are separate files. Though this makes revisions easier I really don't think it's wise to do for SEO reason.

 

People please correct me if I'm wrong. 8)

The quick way to do this is to parse .html extensiosn as PHP then you don't need to chnage anything. Alternatively use permanent 301 redirect for pagename.html to pagename.php then search engines won't lose your pages.

 

In theory the actual page output is going to be the same so you shouldn't lose any SE brownie points :)

  • Author

Have been getting involved in creating an AJAX contact form because I thought if I could develop a contact form that I can easily plug into any website, then my time will be worth it! as yet, I'm still not getting any luck lol

how and where do you do a 301 redirect. I can do this in my server for parked domains but don't know how to do this for individual pages. 8) thanks

  • Author

In the .htaccess file in the root directory

 

Here's mine currently:

 

Redirect 301 /Writing-Design-Breif-Tidy-London.html /tutorials/analysis/website-design-brief-analysis.html

Redirect 301 /Writing-Design-Brief-Tidy-London.html /tutorials/analysis/website-design-brief-analysis.html

 

 

 

 

how and where do you do a 301 redirect. I can do this in my server for parked domains but don't know how to do this for individual pages. 8) thanks

thanks. But where do you put the old url and the new url? 8)

You'd be better off with bluedreamer's initial solution. Parse the contact.html file as a PHP file. You won't have to deal with redirects, or even rename the contact page. Just add the PHP in the HTML and you're done.

You'd be better off with bluedreamer's initial solution. Parse the contact.html file as a PHP file. You won't have to deal with redirects, or even rename the contact page. Just add the PHP in the HTML and you're done.

 

Got to agree - Bluedreamer's first advice is the best way to go if there's only a bit of PHP on each page - it's what makes PHP so great. Just add something like this to your htaccess:

 

Addhandler application/x-httpd-php4 .html .htm

 

Then leave the pages as .html and just add the PHP blocks where needed (use includes for big chunks to keep it neat), It's a far more flexible and neater solution, avoiding redirects and what about if you change your mind about PHP later on?!

  • 1 month later...
You'd be better off with bluedreamer's initial solution. Parse the contact.html file as a PHP file. You won't have to deal with redirects, or even rename the contact page. Just add the PHP in the HTML and you're done.

 

Agree! Logical solution

 

Little James

  • Jo 90 locked this topic
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.