CodeIgniter Forums
Removing /index.php/ Running on XAMPP on a virtual host - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter Archived (from EllisLab) (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Removing /index.php/ Running on XAMPP on a virtual host (/thread-54241.html)



Removing /index.php/ Running on XAMPP on a virtual host - El Forum - 08-29-2012

[eluser]xecure[/eluser]
Hi guys I tried using the code given in the documentation. For reference this is the code I'm using:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

But it isn't working. My set up is a little unique. I'm running XAMPP under windows 8. Even though my XAMPP is installed at C:\xampp My document root isn't C:\xampp\htdocs. I've set up a virtual host so (I believe) my document root is at C:\Users\userName\Dropbox\Projects\projectName. (typing in http://localhost on my browser points to C:\Users\userName\Dropbox\Projects\projectName\index.php)

My .htaccess file is located at C:\Users\userName\Dropbox\Projects\projectName\.htaccess


Removing /index.php/ Running on XAMPP on a virtual host - El Forum - 08-30-2012

[eluser]puffnstuff[/eluser]
Did you remove index.php from your config file? Also try removing the slash in front of index.php


Removing /index.php/ Running on XAMPP on a virtual host - El Forum - 08-30-2012

[eluser]xecure[/eluser]
I'm assuming you're taking about /config/config.php I did a ctrl + F on that file and there isn't any string of characters that say 'index.php'

I have never used a php framework (though have used php before) and I'm modifying a web app developed by another team. Please bear with me if I ask obvious questions.

Also tried removing the slash in front of the index.php in my .htaccess file with no luck.


Removing /index.php/ Running on XAMPP on a virtual host - El Forum - 08-31-2012

[eluser]xecure[/eluser]
bump..


Removing /index.php/ Running on XAMPP on a virtual host - El Forum - 08-31-2012

[eluser]Pendorcho[/eluser]
There may be a problem in the virtual host. Try to set up your DocumentRoot to your project location and same for the Directory of your DocumentRoot. Reset apache. The config.php must be black: $config['index_page'] = '';.

I had the same problem because the inclusion of .htaccess try to search in another directory (check yout apache error log).


Removing /index.php/ Running on XAMPP on a virtual host - El Forum - 08-31-2012

[eluser]Pendorcho[/eluser]
Also on XAMPP enable the module rewrite_module (disabled by default)


Removing /index.php/ Running on XAMPP on a virtual host - El Forum - 09-01-2012

[eluser]xecure[/eluser]
[quote author="Pendorcho" date="1346461858"]Also on XAMPP enable the module rewrite_module (disabled by default)[/quote]How do I enable this? In my httpd.conf file i did a ctrl + F for rewrite_module and this is the line I see:
Code:
LoadModule rewrite_module modules/mod_rewrite.so
Is it enabled?


Removing /index.php/ Running on XAMPP on a virtual host - El Forum - 09-05-2012

[eluser]xecure[/eluser]
bump..

According to my httpd.conf file mod_rewrite is turned on (it was by default on XAMPP, I don't know if it's always like this)

I've uploaded a copy of the site to a separate host with this .htaccess file:
Code:
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ /index.php/ [NC,L]
and it all works well. I've used this exact same .htaccess file on my local host but I'm still getting


Removing /index.php/ Running on XAMPP on a virtual host - El Forum - 09-05-2012

[eluser]PhilTem[/eluser]
How about AllowOverride in your httpd.conf of you XAMPP?


Removing /index.php/ Running on XAMPP on a virtual host - El Forum - 09-06-2012

[eluser]xecure[/eluser]
[quote author="PhilTem" date="1346880748"]How about AllowOverride in your httpd.conf of you XAMPP?[/quote]I think it had something to do with this. For future readers and reference this is the .htaccess that worked properly:

Code:
NameVirtualHost *
<VirtualHost *>
    DocumentRoot "C:\xampp\htdocs"
    ServerName localhost
</VirtualHost>
<VirtualHost *>
    DocumentRoot "C:\Users\Uname\Google Drive\Development\Source"
    ServerName merchantfuse.localhost
    <Directory "C:\Users\Uname\Google Drive\Development\Source">
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>