CodeIgniter Forums
Redirect another view using htaccess - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: Best Practices (https://forum.codeigniter.com/forum-12.html)
+--- Thread: Redirect another view using htaccess (/thread-67537.html)



Redirect another view using htaccess - rupamhazra - 03-07-2017

Hi all,

I want to access a link

http://localhost/controller/function/product_id -->  view 
to
http://localhost/same_controller/same_function/product_name --> same view open.

Using Htaccess.


RE: Redirect another view using htaccess - InsiteFX - 03-07-2017

Why .htaccess? Just setup a route to do it.


RE: Redirect another view using htaccess - j0nzi - 03-07-2017

Create file in your Codeigniter folder then save as ".htaccess" 
then paste this...

RewriteEngine on
RewriteCond $1 !^(index\.php|assets|images|js|css|uploads|favicon.png)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ^(.*)$ ./index.php/$1 [L]


RE: Redirect another view using htaccess - Wouter60 - 03-07-2017

@rupamhazra: why?