Welcome Guest, Not a member yet? Register   Sign In
Routing URL && Sub domains
#2

[eluser]Crazy88s[/eluser]
Hi,

I come from a .NET world too and am learning my way around CI. I'll assume you are using Windows. You'll need to use a .htaccess file.

Here's what I did.

My application resides in a folder under my htdocs directory. I created a .htaccess file with the following contents:

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /CommunityRoute
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index\.php|images|robots\.txt)
    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>

I then modified the httpd.conf file and removed the # from the line:
LoadModule rewrite_module modules/mod_rewrite.so

You'll need to restart apache after this.

In the config.php file for my CI application I changed the following:

Code:
$config['base_url'] = "http://localhost/myCIFolder/";
$config['index_page'] = "";

That should do it.


Messages In This Thread
Routing URL && Sub domains - by El Forum - 04-09-2008, 12:49 PM
Routing URL && Sub domains - by El Forum - 04-09-2008, 01:35 PM
Routing URL && Sub domains - by El Forum - 04-09-2008, 01:48 PM
Routing URL && Sub domains - by El Forum - 04-09-2008, 03:36 PM
Routing URL && Sub domains - by El Forum - 04-09-2008, 05:43 PM
Routing URL && Sub domains - by El Forum - 04-13-2008, 05:07 PM
Routing URL && Sub domains - by El Forum - 04-13-2008, 05:35 PM
Routing URL && Sub domains - by El Forum - 04-14-2008, 07:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB