Welcome Guest, Not a member yet? Register   Sign In
Redirect page on codeigniter
Thumbs Up 
(This post was last modified: 06-14-2017, 12:26 AM by ciadmin. Edit Reason: sanitize possible seo spam links )

Dear All,

I want to ask,
How to redirect the website page in codeigniter?

Example :

Hosting A : example.com/login

want to redirect

Hosting B : example.net/login

Habib Musyaddat

You use your htaccess to redirect that domain redirect ... or you can use PHP location

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteCond %{HTTP_HOST} ^example.com$ [OR]
 RewriteCond %{HTTP_HOST} ^www.example.com$
 RewriteRule (.*)$ http://www.example.net/$1 [R=301,L]
or just for one file:
Redirect 301 /path/to/site/root/login http://www.example.net/login

or, in PHP (although this required that example.com/login actually load, which seems pointless...)
PHP Code:
header('Location: '.$newURL); 

Theme © iAndrew 2016 - Forum software by © MyBB