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

  • Home
  • SEARCH
  • 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 6728567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:11:11+00:00 2026-05-26T10:11:11+00:00

I’m using a CMS that sends all requests to an index.php file using the

  • 0

I’m using a CMS that sends all requests to an index.php file using the following RewriteRule

RewriteRule .* index.php [L]         

However in the news section of the site the CMS is generating news links like this: /news?month=201106

I want my news links like this: /news/month/201106 and I will achieve this with PHP code.

I know pretty much how to achieve the rewrite with Apache if it weren’t for that catchall I would use something like this:

RewriteRule ^news/month/(.+)$ news?month=$1 

However my problem is that the CMS is catching the calls and trying to find /news/month/201106 which it cannot and throws an CMS level 404

I’ve read up about making exceptions but I can’t work out how to get:

  1. Apache to catch the rewrite before it gets sent to the catch all
  2. The CMS to then process the rewritten URL as normal (ie: receive news?month=201106 and process that as normal)

I’m sure this is probably down to the Rewrite flag and the order in which these directives are written but I just cannot get it to work.

  • 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-26T10:11:11+00:00Added an answer on May 26, 2026 at 10:11 am

    1) Apache to catch the rewrite before it gets sent to the catch all

    You can do this by adding a RewriteCond before your RewriteRule .* index.php [L], so that it looks something like this:

    RewriteCond %{REQUEST_URI} !^/news
    RewriteRule .* index.php [L]
    

    2) The CMS to then process the rewritten URL as normal (ie: receive news?month=201106 and process that as normal)

    The 2nd rule that you had, RewriteRule ^news/month/(.+)$ news?month=$1 should take care of that.

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

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have just tried to save a simple *.rtf file with some websites and

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.