Welcome Guest, Not a member yet? Register   Sign In
Redirect page on codeigniter
#1
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


Regards,
Habib Musyaddat
Reply
#2

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

Code:
<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]
</IfModule>
or just for one file:
Code:
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); 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB