Ask a question in MVC mode. Please help. MVC link root directory
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 Tom. hope you can help me.
Reply to discussion (solution)
./Index. php/controller/action
./Index. php/controller/action
I used. htaccess to hide index. php. Is the URL overwritten. Is there a way to rewrite my link and locate my directory to/echo. Of course. If my entire website is under the root directory of www.www/, this problem may not occur .. But is there a solution to this problem? Amount
You have to check the directory settings of your site.
You have to check the directory settings of your site. What do you mean. How to set it. RewriteBase/echo
Is that true?
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]
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]
This is true. But no other ones can be accessed...
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]
Maybe .. Is it because I think too much? Actually, there are not many such applications, right? That is to say, most websites are stored in the root directory. And there will be no more two websites in the root directory?
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]
Ah. Moderator, do you have any suggestions for learning MVC. Or is there any resource for me to watch and learn. You can learn from small projects that have been written by wood or wood.