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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:40:06+00:00 2026-05-29T07:40:06+00:00

Lets say I have a site that has one page that handles all requests

  • 0

Lets say I have a site that has one page that handles all requests (index.php)

Now, I want tidy URL’s, so I can use .htaccess to redirect to valid URL’s –

part 1 – re-directing all requests to index page where the url string is “exploded” into an array for parsing:

RewriteCond $1 !^(index\.php|robots|files|blog|[0-9]+$)
RewriteRule ^(.*)$ index.php?page=$1 [L]

part 2 – http://example.com/123456:

RewriteRule ^([0-9]+)$ index.php?user=$1 [L]

part 3 – http://example.com/blog/blog_title.html:

RewriteRule ^blog/([a-z0-9-_]+)\.html$ index.php?blog=$1 [L]
RewriteRule ^blog/. /blog/ [R]

Obviously here, I am redirecting the blog post to index.php with the blog variable being the part before “.html” (blog_title), along with any non-compliant URL’s being forwarded to the /blog/ directory.

The problem I have is that I need to then re-direct the URL to “index.php?page=blog” while keeping the address bar displaying http://example.com/blog/

any help would be appreciated!

  • 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-29T07:40:07+00:00Added an answer on May 29, 2026 at 7:40 am

    Even though you found the solution yourself, I thought you might be interested in an alternative way to solve this. This is where I came up with 🙂

    RewriteCond $1 !^blog/.
    RewriteCond $1 !^(index\.php|robots|files|[0-9]+$)
    RewriteRule ^(.*)$ index.php?page=$1 [L]
    

    Maybe you could even combine the two conditions into RewriteCond $1 !^(index\.php|robots|files|blog/.|[0-9]+$), but I not sure about the priority of the logical-or (i.e. |).

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

Sidebar

Related Questions

Lets say I have a site that has a Layout with navigation. This navigation
Lets say I have the following one-to-many relationship: Site has many Users User belongs
Lets say I have a simple ecommerce site that sells 100 different t-shirt designs.
let's say I'm working on a site that has 8 to 10 different html/php
Let's say I have a site level feature that has a content type, and
Lets say a have two sites. Site A and site B. On site A
let me explain my current situation i have a SharePoint site lets say it
So I have an asp:imagebutton for lets say loginning into a web site. OnClick
Let's say we have a User Model that has many Posts. The Posts Model
Let's say, on a ColdFusion site, that the user has navigated to http://www.example.com/sub1/ The

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.