thinkphp Redemption URL Rewrite

Source: Internet
Author: User
thinkphp Implementing URL Rewrite
To implement URL rewrite with thinkphp, the directory structure for project Hello is as follows:


Http://localhost/hello/index.php/User/login, this link is possible.
Http://localhost/hello/User/login, this link is not possible.
Http://localhost/hello/User/login

Changes to the Apache httpd.conf file:
LoadModule rewrite_module modules/mod_rewrite.so Enabled


Options FollowSymLinks
AllowOverride All
Order Allow,deny
Allow from all

Modify AllowOverride to All

The contents of the file conf/config.php are as follows:
Return Array (
' Url_model ' = 2
);

added. htaccess with the following content:

Rewriteengine on
Rewritecond%{request_filename}!-d
Rewritecond%{request_filename}!-f
Rewriterule ^ (. *) $ index.php/$1 [qsa,pt,l]


How should I make http://localhost/hello/User/login accessible? Thanks a lot!
------Solution--------------------

Order Allow,deny
Deny from all


Have it?

------Solution--------------------
Under Apache, only the Mod_rewrite module needs to be opened for normal access.
  • 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.