Welcome Guest, Not a member yet? Register   Sign In
Removing index.php in Codeigniter
#31

[eluser]drewdin[/eluser]
Sorry for the confusion,

I started using my windows machine an hour or so ago, when i got to work. since I sync my stuff through dropbox I tend to develop from both places. My MAC and my windows machine. I wont be able to test the MAC until later tonight. I just figured f I could get it going with my windows machine, i would be good.

I'll wait until i get home and re-run the tests. If you will be on later tonight, I would appreciate the help.
#32

[eluser]drewdin[/eluser]
Here is the output from my mac;

Code:
[HTTP_HOST] => localhost
    [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_REFERER] => http://localhost/
    [HTTP_COOKIE] => SQLiteManager_currentLangue=2
    [HTTP_CONNECTION] => keep-alive
    [PATH] => /usr/bin:/bin:/usr/sbin:/sbin
    [SERVER_SIGNATURE] =>
    [SERVER_SOFTWARE] => Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8r DAV/2 PHP/5.4.10
    [SERVER_NAME] => localhost
    [SERVER_ADDR] => ::1
    [SERVER_PORT] => 80
    [REMOTE_ADDR] => ::1
    [DOCUMENT_ROOT] => /Users/Me/Dropbox/www
    [SERVER_ADMIN] => [email protected]
    [SCRIPT_FILENAME] => /Users/Me/Dropbox/www/CodeIgniter/index.php
    [REMOTE_PORT] => 64902
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_PROTOCOL] => HTTP/1.1
    [REQUEST_METHOD] => GET
    [QUERY_STRING] =>
    [REQUEST_URI] => /CodeIgniter/
    [SCRIPT_NAME] => /CodeIgniter/index.php
    [PHP_SELF] => /CodeIgniter/index.php
    [REQUEST_TIME_FLOAT] => 1366150277.15
    [REQUEST_TIME] => 1366150277
    [argv] => Array
        (
        )

    [argc] => 0
#33

[eluser]drewdin[/eluser]
Also, i noticed if I comment out the
Code:
#RewriteBase /CodeIgniter/
nothing happens, the main page loads fine.
#34

[eluser]drewdin[/eluser]
is anyone around to help? I have been struggling with this for a few days...
#35

[eluser]TheFuzzy0ne[/eluser]
Sorry, I'm out of ideas. I'm just hoping that another Mac user will be so kind as to post their .htaccess file.

However, I would suggest that you add your site to your hosts file, and then you can add a virtual host for your Web site, so that you don't have to use RewriteBase anymore.

Code:
<VirtualHost *:80>
    DocumentRoot /path/to/your/site
    ServerName codeigniter.localhost
    <Directory "/path/to/your/site">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

There are differences between the two servers, but this will allow you to specify a different .htaccess file for each, since I doubt one will work on both Windows and your Mac.

Mac:
Code:
<VirtualHost *:80>
    # ...
    AccessFileName .htMaccess
</VirtualHost>

Windows can just use the default .htaccess file.
#36

[eluser]Unknown[/eluser]
[quote author="drewdin" date="1366248048"]is anyone around to help? I have been struggling with this for a few days...[/quote]

Have you changed the server's config file to enable "AllowOverride"

If you use apache server, you need to set all "AllowOverride all" in file "conf/httpd.conf"
#37

[eluser]Geoffrey[/eluser]
[quote author="smilepeng" date="1366902191"]If you use apache server, you need to set all "AllowOverride all" in file "conf/httpd.conf"
[/quote]

You don't need to make it that open. You just need to allow FileInfo.
Code:
AllowOverride FileInfo
#38

[eluser]Unknown[/eluser]
Only enable the mod_rewrite in Apache.it will be solve.
#39

[eluser]Unknown[/eluser]
Hi, I have the same problem also, but I am using the Internet Information Services (IIS) as my local web server. How can I also remove the index.php in my URL, I am very new in CodeIgniter. Thanks.

Attached is the page with the error. I also did what's on this topic.
#40

[eluser]Unknown[/eluser]
That's occour because you are not defining the root path CodeIgniter on your base URL

I'm using this as root .htacces, please try again

RewriteEngine on
RewriteBase /CodeIgniter/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|js|img|css|captcha|robots\.txt)
RewriteRule ^(.*)$ /CodeIgniter/index.php/$1 [L]




Theme © iAndrew 2016 - Forum software by © MyBB