Welcome Guest, Not a member yet? Register   Sign In
results from site_url()
#1

With version 2 it returns http://localhost:8055

With version 3 it returns http://localhost:8030/index.php

I am converting a ver. 2 site to ver. 3, but why did it append /index.php on there, and what can I do about it? It causes my images not to display for one thing.
Reply
#2

By default, the index.php file will be included in your URLs:

Code:
example.com/index.php/news/article/my_article

If your Apache server has mod_rewrite enabled, you can easily remove this file by using a .htaccess file with some simple rules. Here is an example of such a file, using the “negative” method in which everything is redirected except the specified items:

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

In the above example, any HTTP request other than those for existing directories and existing files is treated as a request for your index.php file.
Reply
#3

I tried that .htaccess file but it didn't change the results any.
Reply
#4

Did you remove 'index.php' from index_page config setting in /application/config/config.php? That also needs to be done.
$config['index_page'] = '';

Code:
/*
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config['index_page'] = 'index.php';
Reply
#5

It's working at the moment. Hope it stays that way.
Reply
#6

(04-19-2015, 08:42 AM)cupboy Wrote: I tried that .htaccess file but it didn't change the results any.


hope this helps
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
# !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
# slashes.
# If your page resides at
# http://www.example.com/mypage/test1
# then use
# RewriteBase /mypage/test1/
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php
</IfModule>
Reply




Theme © iAndrew 2016 - Forum software by © MyBB