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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:59:42+00:00 2026-06-12T01:59:42+00:00

i need to know How to forward all url to a single url in

  • 0

i need to know How to forward all url to a single url in yii
all link go to a single url
need this for showing maintenance message

  • 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-12T01:59:43+00:00Added an answer on June 12, 2026 at 1:59 am

    Update

    The old code sample stopped working since Yii 1.1.16. Thanks to JamesG (see comment) for the new solution. Code sample has been updated.


    As you have already figured out, catchAllRequest is the best way to do this from within yii. It has been made specifically for such cases, as is quite evident from the documentation. Using it could also probably give you a slight performance increase (over urlManager), but i doubt that it’ll be noticeable.

    On the other hand if you wish to use urlManager, you can try with (also read comments in code sample):

    1. Version 1.1.16 and above:

      '<url:(.*)>'=>'maintenance/index'
      
    2. Version 1.1.15 and below:

      '<url:(.*)>'=>'maintenance/index'
      
      // '(.*)'=>'maintenance/index' // this used to work in previous versions ...
      // of Yii (below 1.1.16) mainly due to a bug, see notes
      

    Note: This will have to be the first rule in your urlManager’s rules array configuration.

    However as already mentioned by sl4mmer, htaccess or server configuration is the best way to do this, since the server after all catches the request first before sending it to php.


    Note for Bug:
    Check github issue here.

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

Sidebar

Related Questions

Need to know this so that i could send DTMF and that is going
I need to know how to add an a href link to a div?
I need to know which version control systems support single checkout? When I say
I realize that you can't 100% know that this will work in all browsers.
First of all, I need to make it clear - this is for an
Need to know which event triggered after text selection done in Apple iPad. It
I need to know how to change background of expanded list item when it
I need to know how to exclude files/folders from php generated zip. Here is
I need to know on a continuous basis when my UIScrollView is scrolling or
I need to know a couple of things, concerning IRC servers that I couldnt

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.