Forum Moderators: coopster

Message Too Old, No Replies

same filename for static and dynamic pages

         

jcmiras

2:01 pm on Jan 20, 2008 (gmt 0)

10+ Year Member



If I have, for example, static page named "page1.htm" and a php script that generates a webpage named also as "page1.htm", if the visitor typed-in this webpage URL, which of these two will be returned?

Thanks.

jatar_k

2:04 pm on Jan 20, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



is the the exact same url attributed to 2 pages?

they are in the exact some directory as well?

jcmiras

6:24 am on Jan 22, 2008 (gmt 0)

10+ Year Member



Yes, they have the same URL and same directory.

Thanks.

jatar_k

2:57 pm on Jan 22, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



well, since that isn't actually possible to have 2 different files in the same directory with the same name then I am assuming that there is different output depending on what params are used

does the page have extra parameters added when it is 'dynamic'?

have you looked at the actual directory in ftp? there will only be one there.

Have you looked at the script? It should have default content when no params are present.

I guess the actual answer is that it is returning the same page.

omoutop

3:28 pm on Jan 22, 2008 (gmt 0)

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



in case you gonna use an htaccess file for mod_rewritte, the server will return the php page, proccessed by the mod_rewritte command.

jcmiras

1:13 am on Jan 23, 2008 (gmt 0)

10+ Year Member



OK, just to make everything clearer,

I have a php script the process the dynamic page, "http://www.example.com/folder1/script.php?pagenum=1" and a mod_rewrite that will convert that url into "http://www.example.com/page1.htm".

To make the server load of my webhost lower, I intended to convert this dynamically created pages into a static one. That is, I will save a page with filename "page1.htm" in the root directory. Therefore, both of this page, the dynamic and the static one, will have the same URL, and that is, "http://www.example.com/page1.htm".

Now, my question is, what would be returned by the server, the dynamic page or the static page?

omoutop

7:01 am on Jan 23, 2008 (gmt 0)

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



you will get the http://www.example.com/page1.htm (from dynamic page)

the static one is ignored

jcmiras

9:38 am on Jan 23, 2008 (gmt 0)

10+ Year Member



I see... OK. Thanks a lot!

omoutop

2:14 pm on Jan 23, 2008 (gmt 0)

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



just a note:

in case you wish to free some server load, you can have a crontab creating your dynamic->static pages and no htacccess rules for mod_rewritte

that way, server will use the static pages, while the crontab (once per day) will create new/updated ones.

else, you can delete static pages from your server to free up space, and only server dynamic (with mod_rewrite) pages.