CodeIgniter Forums

Full Version: Redirect another view using htaccess
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
Why .htaccess? Just setup a route to do it.
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]
@rupamhazra: why?