I would like to ask a question about the MVC mode. Please help

Source: Internet
Author: User
Ask a question in MVC mode. Please help. I have recently learned about MVC development. Now we have a problem. I use Smarty as V. My entire website is on. Under the WWW/ECHO & nbsp; directory. A problem occurs. for example, when I am on the & lt; a & gt; link, I cannot directly enter a link like & nbsp; control/method. Instead, you need to ask questions about the MVC mode in & nbsp;/echo. Please help me.
Recently, I have been studying MVC development. Now we have a problem. I use Smarty as V. My entire website is on. Under the WWW/ECHO directory. A problem occurs. for example, you cannot directly enter a link such as control/method when linking. You need/echo/control/method to perform the operation. If not. There will be a problem. for example, my current page is localhost/echo/index, and my default controller and method are indexes. I use this page to link to the article page. You can access it through access. However, if the method name is added to my homepage, it becomes. Localhost/echo/index. the address localhost/echo/index/article/index appears when you access the article page using the above link .. How can I solve this problem. I'm a little white. hope you can help me with MVC? Link ?? Share the root directory:
------ Solution --------------------
./Index. php/controller/action
------ Solution --------------------
In the. htaccess Directory of the website root directory, assign the url to echo
RewriteRule ^ (/?) (. *) $/Echo/$2 [PT, L]

Project ing using. htaccess in the echo Directory
RewriteRule ^ (. *) $ index. 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.