Welcome Guest, Not a member yet? Register   Sign In
Always redirect me to the home page
#1

(This post was last modified: 09-27-2016, 03:39 AM by mirindraulki.)

Hi Every body thanks in advance for all for the help
I have a problem when i wish to change a pages.I finish the project and a send the project in a server online
When I want to go in a other page of the site, it redirect me automatically to the index of the main page, and when I want to go to other pages it redirect me again to the homepage
The project work in my local but online it has this problem

Thank you for all
Reply
#2

Change your live config.php file

$config['base_url'] = 'http://www.yoursite.com';
Reply
#3

Did you change your base_url in ,/application/config/config.php to your new online site url?

Is you index.php pointing the application and system folder to the right path?

Check your config url protocol settings and your .htaccess file.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

- Yes , I change my base_url in config.php ,and it' ok in this party

- About my htaccess , here is the content of the file : 

<IfModule authz_core_module>
    Require all denied
</IfModule>
<IfModule !authz_core_module>
    Deny from all
</IfModule>

- And for the index.php,I have not changed  anything since I installed codeigniter,we must change something in the index.php then

here are the content of the file 

$application_folder = 'application';


$system_path = 'system';

$view_folder = '';
Reply
#5

(09-27-2016, 04:04 AM)createweb Wrote: Change your live config.php file

$config['base_url'] = 'http://www.yoursite.com';

I have change it but it ' s not working

base_url = http://XXXXXXXX.com/Projet
Reply
#6

(09-27-2016, 06:18 AM)mirindraulki Wrote:
(09-27-2016, 04:04 AM)createweb Wrote: Change your live config.php file

$config['base_url'] = 'http://www.yoursite.com';

I have change it but it ' s not working

base_url = http://XXXXXXXX.com/Projet

Use this .htaccess file

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

$config['index_page'] = 'index.php';

to

$config['index_page'] = ' ';
Reply
#7

Hi,

I ' ll show you myvonfiguration

application  > .htaccess 

<IfModule authz_core_module>
    Require all denied
</IfModule>
<IfModule !authz_core_module>
    Deny from all
</IfModule>

I've tried to change this htaccess in many times but it's not working

for example : 

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

------------------------------------------------------------------------------------------------------------------------------------------
for the configuration 

- base_url = "http://xxxxxxxx.com/Projet"

- index_page = 'index.php'

in the route.php

$route['default_controller'] = 'HomeController';

it will redirect me automatickly in the function index of the controller, when i change the view in this index,the code work successfully but when i try to enter in other controller with a link or in a url,it' s not working,it redirect me forever in the homepage that i define in the function index

I think that it is a problem of htaccess but i don't know how 

Thanks a lot for every help
Reply
#8

You need to add the trailing slash to your base url:

PHP Code:
$config['base_url'] = "http://xxxxxxxx.com/Projet/"

You may need to change the .htaccess file to this:

Code:
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

You may also need to try a different URI protocol:

PHP Code:
$config['uri_protocol']    = 'REQUEST_URI'
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#9

I ' ve try everytihng but it's not working guys


htaccess , base_url ,session,etc but i ' m always redirected in the controller where i defined in the route
Reply
#10

Post your directory structure of your online server here.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB