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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:57:37+00:00 2026-06-10T18:57:37+00:00

I have to completely replace an existing website. The current site is completely spagetti

  • 0

I have to completely replace an existing website. The current site is completely spagetti code with some rewrite rules to mimic friendly urls.

There are some mission critical issues that can’t be resolved with the current architecture and database structure, so for a time both code bases need to live side by side.

This is the current .htaccess

Options +FollowSymLinks
RewriteEngine On 

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^([^/]+)/$ $1.html
RewriteRule ^([^/]+)/$ $1.php

RewriteRule ^([^/]+)/([^/]+)/$ $1.php?q=$2
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/$ $1.php?q=$2&r=$3
RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/$ $1.php?q=$2&r=$3&s=$4

I’m replacing it with a zend framework site, but it routes everything through the index.php file for the routing

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f [NC,OR]
RewriteCond %{REQUEST_FILENAME} -d [NC]
RewriteRule .* - [L]
RewriteRule .* index.php

Does anyone have any idea how I can combine the two until the original can be completely replaced?

  • 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-06-10T18:57:38+00:00Added an answer on June 10, 2026 at 6:57 pm

    If you can map your old URLs to Zend Url someway, then it would be rather easy. Let’s say you had

    http://foo.bar.com/something.php?q=arg1&r=arg2
    

    then if you have this functionality working in Zend code, then you must also have valid URL there, like

    http://foo.bar.com/something/q/arg1/r/arg2
    

    If so, all you need is to rewrite that old URLs to Zend URL and instead of doing internal redirection, do HTTP redirection, i.e. (out of my head, not tested):

    RewriteCond %{QUERY_STRING} ^q=(.*)&r=(.*)^  
    RewriteRule ^something\.php$ /something/q/%1/r/%2? [R=301,L]
    

    Mind the trailing “?” which tells mod_rewrite NOT to attach original query string to rewritten one (otherwise you would end with /something/q/%1/r/%2?q=X&r=y. Note we do regular 301 HTTP redirection here.

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

Sidebar

Related Questions

I have some code that is used to replace certain page output with other
I am working on some homework here, but I have completely run out of
I am completely confused - I have a website that renders perfectly in IE8
I have a class ChildClass that extends the class ParentClass. Rather than completely replace
I have some id tags which I need to remove completely, including its value.
I'm making some changes to an existing website with CSS drop-down (drop-up, actually) menus
Note I have completely re-written my original post to better explain the issue I
My application has several independent top-level windows, which all have completely different functions/workflows. I
I have a completely empty RavenHQ database that's linked to my Appharbor application. The
For doing builds, packaging files up, etc, it's needed to have a completely clean

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.