How can I change the index page in cakephp?

I want to host a managed site and only want to change the index page. I tried but it affects other site urls like admin. Please let me know another solution. I made changes to routes.php.

Router::connect('/', array(
    'controller' => 'sightings',
    'action' => 'index',
));

      

I named another method instead of index. But its not working. Please let me know another way in cakephp

+3


source to share


2 answers


I created a new controller and assigned a service to the site. It works fine now.



0


source


You have a hierarchy of .htaaccess files on your server. One of them is at the root level. Edit some data and put this code to redirect visitors to the service page:



# MAINTENANCE-PAGE REDIRECT
<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000
 RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]
 RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
 RewriteRule .* /maintenance.html [R=302,L]
</IfModule>

      

0


source







All Articles