I want to submit the form to www.example.com/users/signup but my page is submitting to www.example.com/test/users/signup. Cakephp is installed in test folder. I have created htaccess inside test folder. This is my htaccess:
<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ test/ [L] RewriteRule (.*) test/$1 [L] RewriteRule ^$ /test/users/signup [L] RewriteRule users/signup /users/signup [L] </IfModule>
View:
<?php echo $this->Form->create('User',array('url'=>array('controller'=>'users','action'=>'signup')), array('id' => 'signup', 'role' => 'form','class'=>'form-signin')); echo $this->Form->input('User.email',array('type'=>'email','required'=>'required','class'=>'form-control','placeholder'=>'Email')); echo $this->Form->input('User.password',array('type'=>'password','required'=>'required','class'=>'form-control','placeholder'=>'Password')); ?> <button type="submit" class="btn btn-lg btn-primary btn-block">Sign up</button> <?php echo $this -> Form -> end(); ?>
I created the routes:
<?php Router::connect('/users/signup', array('controller' => 'users', 'action' => 'signup')); ?>
If you want to ask any query please feel free to ask.