Question about using php redirect for link cloaking

copywriter's picture

Hello...

When using a php redirect for link cloaking (the method Jeremy shows in his video) do ALL my OTHER website files have to have a .php extension or can they have a .html extension?

I'm unsure whether all extensions for my website must be .php if I want to use php redirect for link cloaking (or whether I can have BOTH .php and .html extensions for my website).

Thanks for your help!

Question about using php redirect for link cloaking

Green Giant's picture

Any page that you are planning on having your tracking run through must be a page with a .php extension. This means your landing page and any jump pages you've created for the visitor to go through before or after they get to your landing page. Any page without the .php extension will not execute any php code that is on the page.

I haven't found any reason not to have a .php extension on all my pages. Even my privacy and about pages are php and transfer my tracking codes between them just in case the visitor goes to those pages before clicking on an affiliate link.

Mike

Question about using php redirect for link cloaking

Jeremy Palmer's picture

Green Giant wrote:
Any page that you are planning on having your tracking run through must be a page with a .php extension. This means your landing page and any jump pages you've created for the visitor to go through before or after they get to your landing page. Any page without the .php extension will not execute any php code that is on the page.

I haven't found any reason not to have a .php extension on all my pages. Even my privacy and about pages are php and transfer my tracking codes between them just in case the visitor goes to those pages before clicking on an affiliate link.

Mike

I agree 100% with Mike. Unless you have a compelling reason not to, just use .php for all your file extensions. It gives you flexibility to add dynamic functions to your page now or in the future.

You can technically do this with .html pages too (by changing an Apache config file) but many hosts don't allow you to do this.

Best,

Jeremy

I might add, an HTML file is

kdpem's picture

I might add,
an HTML file is the same thing as a PHP file, the only difference is you can use PHP in the file with the php extension and php will not run in an html file. Simply changing the html extension to php will not change the way it is displayed so all you would have to do to make the change is rename the file. Then any code can be put in your file and you can add any php feature.

Kevin

You can also use htaccess

Bobby's picture

If you have a lot of SEO in place, just changing file names can Hurt!

If this is the case, use htaccess to handle this (there's multiple ways to do it -- you can have every request rewritten or redirected or just have PHP handle .html files too, etc., etc., etc.)

php rocks

infoz's picture

Although i am not a programmer i have picked up a little php. This is an amazing language that is so versatile i have 4 sites that are all php and i dont think i will ever do and html site again.

If you already have a site with .html pages indexed just do perminent redirect 301 permanent redirect to the new page. I recommend doing only a few at time if youre highly concerned with seo or indexing with a super huge site but i have never hand any issues.

Syndicate content