Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 500057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:02:54+00:00 2026-05-13T06:02:54+00:00

So, currently I’m organizing my blog based on filename: To create a post I

  • 0

So, currently I’m organizing my blog based on filename: To create a post I enter the name of the file. As opposed to storing the post in the database, I store them in PHP files. So each time I create a post, A new row in the table is created with the filename and a unique ID. To reference the post (e.g. for comments) I get the name of the current file, then search the entries table for a matching file name. The post ID of the comment matches the ID of that post.

Obviously this isn’t the standard way of organizing a blog, but I do it this way for a few reasons:

  • Clean URL’s (even cleaner than mod_rewrite can provide from what I’ve read)
  • I always have a hard copy of the post on my machine
  • Easier to remember the URL of a specific post (kind of a part of clean URL’s)

Now I know that the standard way would be storing each post in the database. I know how to do this, but the clean URL’s is the main problem. So now to my questions:

  • Is there anything WRONG with the way I’m doing it now, or could any problems arise from it in the future?
  • Can the same level of clean URL’s that I can get now be achieved with mod_rewrite? If so, links are appreciated
  • I will be hosting this on a web host. Do only certain web-hosts provide access to the necessary files for mod_rewrite, or is it generally standard on all web-hosts?

Thanks so much guys!

P.S. To be clear, I don’t plan on using a blogging engine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:02:55+00:00Added an answer on May 13, 2026 at 6:02 am

    As cletus said, this is similar to Movable Type. There’s nothing inherently wrong with storing your data in files.

    One thing that comes to mind is: how much are you storing in the files? Just the post content, or does each PHP file contain a copy of the entire design of the page as opposed to using a base template? How difficult would it be to change the design later on? This may or may not be a problem.

    What exactly are you looking for in terms of clean URLs? Rewrite rules are quite powerful and flexible. By using mod_rewrite in conjunction with a main PHP file that answers all requests, you can pretty much have any URL format you want, including user-friendly URLs without obscure ID numbers or even file extensions.

    Edit:

    Here is how it would work with mod_rewrite and a main PHP file that processes requests:

    1. Web server passes all requests (e.g., /my-post-title) to, say, index.php
    2. index.php parses the request path (“my-post-title”)
    3. Look up “my-post-title” in the database’s “slug” or “friendly name” (whatever you want to call it) column and locates the appropriate row that way
    4. Retrieve the post from the database
    5. Apply a template to the post data
    6. Return the completed page to the client

    This is essentially how systems like Drupal and WordPress work.

    Also, regarding how Movable Type works, it’s been a while since I’ve used it so I might be wrong, but I believe it stores all posts in the database. When you hit the publish button, it generates plain HTML files by pulling post data from the database and inserting it into a template. This is incredibly efficient when your site is under heavy load – there are no scripts running when a visitor opens up your website, and the server can keep up with heavy visitation when it only needs to serve up static files.

    So obviously you’ve got a lot of options when figuring out how your solution should work. The one you proposed sounds fine, though you might want to give careful consideration to how you’ll maintain a large number of posts in individual files, particularly if you want to change the design of the entire site later on. You might want to consider a templating engine like Smarty, and just store post data (no layout tags) in your individual files, for instance. Or just use some basic include() statements in your post files to suck in headers, footers, nav menus, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have this code: <?php echo '<meta name=robots content=noindex>'; $arr = json_decode(file_get_contents(http://media1.clubpenguin.com/play/en/web_service/game_configs/ paper_items.json),true);
Currently, I have a log file of messages in one table in a MySQL
I want use html5's new tag to play a wav file (currently only supported
Currently, I have a GWT based application /app.htm It displays an openId login button
Currently using a MySQL database Wanting to insert a new row into a table
Currently, I am copying a database from my assets folder to the to the
Currently I'm learning C++ and I've been trying to create a simple image processing
Currently working on database part of android project. The main aim of the project
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.
Currently, I am writing up a bit of a product-based CMS as my first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.