Forum Moderators: mack

Message Too Old, No Replies

changing htm page to php

parsing? redirecting?

         

Doood

5:08 pm on May 24, 2003 (gmt 0)

10+ Year Member



I have a high traffic page that is saved as htm and use phpadsnew to show text ads on it. The method phpadsnew uses to show links for htm pages (remote invocation for javascript) is way too slow, so I have to change the page to php and use local mode so the links will load faster.

Do I just redirect the visitors to the php page or is there someway that if they click on a link to the htm page it will automatically just appear as the php one? Will this put an extra load on the server?

Like I said before, it's a high traffic page and I've been scared to try something for fear that it would screw up somehow. I've already lost 10k-15k visitors per day because the links load so slow and I don't want to lose anymore.

What do you think the best way to accomplish this is?

Slade

5:15 pm on May 24, 2003 (gmt 0)

10+ Year Member



You can use mod_rewrite to specifically target that .htm page and have it internally redirect to a .php one. Or, you can turn on php parsing for your .htm pages. (What I've read says the second option would cause more load than the first, since every .htm page would be run through the php parser.)

Doood

5:38 pm on May 24, 2003 (gmt 0)

10+ Year Member



That does look like the way to go, thanks.

Since I have no prior knowledge of how to use this and it looks complex, can anyone simplify how to use mod_rewrite for my situation?

Also, by using this is it possible that some visitors may not be redirected to the .php page and will not be able to view the page?

Doood

6:43 pm on May 24, 2003 (gmt 0)

10+ Year Member



I get a lot of search engine traffic as well, will the SE's understand this change or will something need to be done like a 301 htaccess? Or do no other changed neeed to be made.

jatar_k

6:59 pm on May 24, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I think i would just turn on php parsing for .htm.

I cant remember the last time i used just straight non parsed htm/html pages and i havent had any load problems.

That will save all the problems of possibly losing any traffic.

Slade

7:54 pm on May 24, 2003 (gmt 0)

10+ Year Member



The instance I was describing no one would ever know the redirect to the php file was happening.

Take a look at: [httpd.apache.org...]

See section: Content Handling, From Old to New (intern)

jatar_k

8:03 pm on May 24, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



It just seems like using a power saw to cut coupons though.

Doood

8:59 pm on May 24, 2003 (gmt 0)

10+ Year Member



It sounds like php parsing for .htm may create a redirect lag time or something and may not be completely desirable. I don't know though cause I've never used it I don't think.

If I don't feel comfortable using the mod_rewrite I'll try the parsing. It looks easy enough from the content handling old to new section but I still have no idea how to do it or where to start. Thanks for the help so far.

Doood

9:06 pm on May 24, 2003 (gmt 0)

10+ Year Member



A friend just gave me this to try...

.htaccess file:

AuthUserFile /dev/null
AuthGroupFile /dev/null
Options FollowSymLinks
RewriteEngine on
RewriteRule ^thepage\.htm$ [mydomain.com...]
[R,L]

Can you guys verify that this will work if I use it.

brotherhood of LAN

9:07 pm on May 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I plumped for jatars suggestion when encountering the same problem, all .htm pages are parsed through PHP, and most my pages retrieve their content from a DB. No problems @ 15K page views a day. I guess you're visitation is much higher since you mention losing that amount!

I'm not sure if it's the slower method, but it's certainly the easiest, just one line of code should do the trick to tell PHP to deal with the .htm pages.

jatar_k

11:19 pm on May 24, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



no rewrite expert myself but this might give you some tips
An Introduction to Redirecting URLs on an Apache Server [webmasterworld.com]

Slade

12:10 am on May 25, 2003 (gmt 0)

10+ Year Member



It looks easy enough...

Arr, matey, and with that it has you...

Don't let it fool you, it's not simple by any means.

Doood

2:47 pm on Jun 4, 2003 (gmt 0)

10+ Year Member



This is what I ended up using in .htaccess

Redirect permanent /oldpage.htm
[mydomain.com...]

it seems to work just fine. My only worry is that Google won't understand it and will mess with my page ranking. Should I do something so I won't lose my good spot on Google?

Doood

3:01 pm on Jun 4, 2003 (gmt 0)

10+ Year Member



<edit> oops double post </edit>