URL redirection in the framework using a novice issue

Source: Internet
Author: User
When using zendframework, you need to use the URL redirection feature to unify the portal for site access.
The server software I'm using is the apache2.4,url redirection rule I wrote it this way:
Rewritecond%{request_uri}!^.* (\.js|\.gif|\.jpg|\.png|\.css|\.html) $
Rewriterule ^/.*$/index.php
However, there is a problem with this writing, because the URL is rewritten as/index.php, so the site will not be able to pass in the URL passed parameters.
So my question now is: Is there any way to redirect all access to index.php and also to pass parameters at the URL?


Reply to discussion (solution)

Rewriterule ^/? (. *) $/index.php$1

Rewriterule ^/? (. *) $/index.php$1


After this change, there is nothing to match, I use Apache 2.4. The URL is not overridden according to the page returned

Actually, you should use his own rewrite rules.
Rewritecond%{request_filename}!-d
Rewritecond%{request_filename}!-f
Rewriterule ^ (. *) $ iindex.php/$1 [qsa,pt,l]

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.