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 6322559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:21:17+00:00 2026-05-24T16:21:17+00:00

A site done completely in HTML now needs to have some content added to

  • 0

A site done completely in HTML now needs to have some content added to some pages. Editing the HTML is not an option. The HTML is consistent between pages. The displayed URL should be the same as before.

So far I’ve come up with the following strategy:

  1. Handle the HTML pages as PHP by adding the requisite directive to .htaccess

    AddType application/x-httpd-php .html .htm

  2. Use mod_rewrite directives to send requests to a PHP script. I cannot work out what to do in this step.

  3. PHP script will have a list of pages that need the content added and will add it based on conditions. How would I handle the input from the htaccess file to begin with? And are my thoughts of using fopen and preg through the HTML and adding the content in the required position the way to go?

To be clear, I’m asking whether my strategy will work and for help in going through with it and also asking if there is a better way of doing this.

Before anybody asks, the application of this is somewhat controversial and the client is well aware of it.

  • 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-24T16:21:18+00:00Added an answer on May 24, 2026 at 4:21 pm

    1. No need for that, at all.

    2. With this sort of rule you can rewrite (internal redirect) ALL requests for .html and .htm files to a single .php file that will take the original .html file name as a parameter:

    Options +FollowSymLinks -MultiViews
    RewriteEngine On
    RewriteBase /
    
    # the actual rewrite rule
    RewriteRule ^.+\.html?$ /handler.php?url=%{REQUEST_URI} [L]
    

    This rule is intended to be placed in .htaccess file in website root folder. If placed elsewhere some small tweaking may be required.

    3. How you going to handle this inside such php file is up to you. But yes — it is possible to do what you want although it is not a trivial task.

    In your php script use $_GET['url'] to access original URL (or $_SERVER['REQUEST_URI']).

    fopen() should be fine, but I do not really recommend using preg() (it actually depends on what you are trying to do). In any case — look at DOM HTML manipulation routines — it can be safer/faster.

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

Sidebar

Related Questions

Suppose I have 3 completely different layouts for one site. The first is shown
A site I'm working on has Flash headers (using swfobject to embed them). Now
Our site has multiple wizards where various data is collected over several pages, and
the site addres: http://www.ynet.co.il/YediothPortal/Ext/TalkBack/CdaTalkBack/1,2497,L-3650194-0-68-544-0--,00.html fill the form with rubbish. Hit 'Send' the form post
I've been designing a site over the past couple days, and been doing some
My problem is that I have a site which has requires a dedicated page
Site 1 has dll's for x amount of object and data calls. Can Site
My site has a drop-down menu built in CSS and JavaScript that drops down
My site has quite a deep navigation structure and quite often it looks like
What site(s) do you recommend for looking at complimentary colors for site design? It

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.