I recently used cakephp to develop small projects. I found a problem. I have not found a solution for searching materials on the internet. I would like to ask you about it. Cakephp is placed in the animal folder under the root directory of the website. all URLs are sample. comanimal: controller... I want to develop small projects using cakephp recently. I found a problem. I have not found a solution for searching materials on the internet. I would like to ask you about it.
Cakephp is placed in the/animal/folder under the root directory of the website. all URLs are
Http://sample.com/animal/:controller...
To get the content of a controller to the directory at the upper level, for example, change the controller named dog
Http://sample.com/animal/dog...
Http://sample.com/dog...
The current practice is to modify the. htaccess file in the root directory.
Options +FollowSymLinksRewriteEngine onRewriteCond %{REQUEST_URI} !/$RewriteCond %{REQUEST_URI} !\.[^/\.]+$RewriteRule .* %{REQUEST_URI}/ [L,R]RewriteRule ^dog/(.*)/ animal/dog [L]RewriteRule ^dog/(.*) animal/dog [L]
However, the link in HtmlHelper in the view still has/animal /,
Paginator is automatically added with/animal/
echo $this->Html->link( 'Dog', array('controller' => 'dog', 'action' => 'smile'));URL: http://sample.com/animal/dog/smile
How can I modify this type of problem in cakephp configuration? Does it affect the connections of other controllers at the same time?
Thank you !!
Reply content:
I recently used cakephp to develop small projects. I found a problem. I have not found a solution for searching materials on the internet. I would like to ask you about it.
Cakephp is placed in the/animal/folder under the root directory of the website. all URLs are
Http://sample.com/animal/:controller...
To get the content of a controller to the directory at the upper level, for example, change the controller named dog
Http://sample.com/animal/dog...
Http://sample.com/dog...
The current practice is to modify the. htaccess file in the root directory.
Options +FollowSymLinksRewriteEngine onRewriteCond %{REQUEST_URI} !/$RewriteCond %{REQUEST_URI} !\.[^/\.]+$RewriteRule .* %{REQUEST_URI}/ [L,R]RewriteRule ^dog/(.*)/ animal/dog [L]RewriteRule ^dog/(.*) animal/dog [L]
However, the link in HtmlHelper in the view still has/animal /,
Paginator is automatically added with/animal/
echo $this->Html->link( 'Dog', array('controller' => 'dog', 'action' => 'smile'));URL: http://sample.com/animal/dog/smile
How can I modify this type of problem in cakephp configuration? Does it affect the connections of other controllers at the same time?
Thank you !!