Welcome Guest, Not a member yet? Register   Sign In
remove compulsory index.php from request URLs
#1

Hello All,

I am new to CodeIgniter and I'm looking forward to get to know more about this framework. 

I have just completed the static pages tutorial, and now I can access pages of my site (hosted on network NAS) in such a way like  The website itself (and all the framework files) are hosted under the /TestTwo/ directory. My question is, how could I remove that index.php from the url? I have seen some solutions online where they mocked the .htaccess file, I was wondering if there is any other way to achieve this? If there is any instructions on this in some official documentation, it would be nice to see that instead of "raw solutions". I was thinking of editing some configuration file, or the routes.php etc.

I would like to access pages in a manner like http://nas/TestTwo/pages/view

My routes.php is as simple as:
PHP Code:
$route['pages'] = 'pages/view/$1';
$route['translate_uri_dashes'] = FALSE


Cheers,
tmx
Reply
#2

(This post was last modified: 09-01-2016, 01:04 PM by PaulD.)

It is well documented here:

http://www.codeigniter.com/user_guide/ge...x-php-file

Make sure you have set your $config['base_url'] in the config file. In your case it looks like your base url would be 'http://nas/TestTwo/'.

Hope that helps,

Paul
Reply
#3

(09-01-2016, 01:03 PM)PaulD Wrote: It is well documented here:

http://www.codeigniter.com/user_guide/ge...x-php-file

Make sure you have set your $config['base_url'] in the config file. In your case it looks like your base url would be 'http://nas/TestTwo/'.

Hope that helps,

Paul

Hey,

That did the work. I've just created the .htaccess next to the index.php. Thanks!

Thomas
Reply




Theme © iAndrew 2016 - Forum software by © MyBB