![]() |
Rewrite an URL without 302 redirect - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: Rewrite an URL without 302 redirect (/showthread.php?tid=61785) |
Rewrite an URL without 302 redirect - ricoxor - 05-16-2015 I would like to know, how can i rewrite an URL without the 302 redirection. The website is targeted by 2 domains. - The first domains `(domain1.com)` focus all the website. - The second domains `(domain2.com)` focus only one function to do an url shortener Here is my `.htaccess` : Code: Options +FollowSymlinks When i call my shothener `http://domain2.com/57b97f2` i'am redirect to `http://domain2.com/url/57b97f2` with a 302 redirection. How can i avoid this unwanted 302 redirection ? My controller for the `url()` function is named : `webadmin` My routes are : Code: $route['default_controller'] = 'webadmin'; Webadmin controller : Code: function url($code) EDIT : I try to use : Code: RewriteCond %{HTTP_HOST} ^(www\.)?domain2\.com$ But an 404 error is showing... RE: Rewrite an URL without 302 redirect - ricoxor - 05-16-2015 On the config.php i have change : $_SERVER['REQUEST_URI'] to $_SERVER['QUERY_STRING'] and now it work. But i don't know why... Can you explain me ? Thank's RE: Rewrite an URL without 302 redirect - InsiteFX - 05-17-2015 It depends on how they setup their server. |