PDA

View Full Version : confusion over mod_rewrite and static pages!



moonshield
12-26-2004, 07:51 PM
Okay, the purpose of mod_rewrite is to make dynamic pages look like they are static pages right? I know this is stupid, but If I am using static pages do I need to use mod_rewrite?

r2d2
12-27-2004, 02:04 AM
Okay, the purpose of mod_rewrite is to make dynamic pages look like they are static pages right?

Normally, yes, but given your second question, would have to say thats not all you can use it for.



I know this is stupid, but If I am using static pages do I need to use mod_rewrite?

You may want to rewrite your .php extensions as .html. So you have 'index.html' not 'index.php' etc... Some people like to hide their serverside language, may also seem a little more 'friendly' for users.

Using .htaccess I think you could either convert all cases of .html to .php before they reached your server, and have your files saved as .php so they go through the php module as normal, OR you could actually save your files as .html and then setup .htaccess to send all .html through the php module like .php normally would be.

AndyH
12-27-2004, 02:10 AM
No, you don't. It will just be hard to make changes to the "system" (website) in the future.

moonshield
12-27-2004, 10:53 AM
cool, exactly what I had thought. Thanks. I asked this because I had over 600 static .html pages for a new site I am working on and wondered if I needed to do something to em.

AndyH, I know it is difficult changing the pages, I have done it once already, I misspelled an item on the menu :)

r2d2
12-27-2004, 12:33 PM
Thats actually where you would want to be using PHP, all my sites, and I suspect most people on here, only have one copy of header.php and footer.php then just change the main content, copying in the template header and footer for each page. Menu would probably be in header.php so only need to make one change.

ozgression
12-27-2004, 02:10 PM
Yes, I would use php includes for a header and footer. That way you only have to update the menu in one file and it changes on every page.

moonshield
12-27-2004, 04:48 PM
indeed, that would make sense