Can't seem to remove "index.php" from URLS on my new server? It's a server configuration issue that I can't figure out! - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Can't seem to remove "index.php" from URLS on my new server? It's a server configuration issue that I can't figure out! (/showthread.php?tid=49714) |
Can't seem to remove "index.php" from URLS on my new server? It's a server configuration issue that I can't figure out! - El Forum - 02-29-2012 [eluser]skcin7[/eluser] Help! I recently moved to a new server, and mod_rewrite in my .htaccess file doesn't seem to be properly rewriting the "index.php" to remove it from my URLs. I didn't change any of my files from my existing server, so this tells me that it's some kind of server configuration issue, which makes sense since I just switched servers. Fortunately, I have full access to the server, so I can change anything I need to. If you can help me figure out this problem, it would be most appreciated. This is what my .htaccess file looks like. Code: <IfModule mod_rewrite.c> This is what my vhost.conf apache file looks like (I think the problem might be in here) Code: NameVirtualHost *:80 I don't think it has to do with my general apache or PHP configuration files so I'm not going to copy/paste them here. They're also much MUCH longer. If you need to see my phpinfo, you can find it here: http://www.nmwebstudio.com/phpinfo.php Oh by the way, the site is here: http://www.nmwebstudio.com/ If you click on the "About" tab at the top, you will see what I'm talking about, but you can manually add "index.php" into the URL and it will work fine. Thanks in advance for any help you may provide. Can't seem to remove "index.php" from URLS on my new server? It's a server configuration issue that I can't figure out! - El Forum - 02-29-2012 [eluser]CroNiX[/eluser] Are you using 2.1? If so, you can safely remove this: Code: #Removes access to the system folder by users. You might try removing the ? in the last line that is like Code: RewriteRule ^(.*)$ index.php?/$1 [L] The problem could be in the apache conf as well. If they don't allow you to override default values, it won't use the rewrite. Here are some directives that have worked for me: Code: Options Indexes FollowSymLinks It could also be that your if block Code: <IfModule mod_rewrite.c> Code: <IfModule mod_rewrite.so> Can't seem to remove "index.php" from URLS on my new server? It's a server configuration issue that I can't figure out! - El Forum - 02-29-2012 [eluser]skcin7[/eluser] Thanks for your reply. I am using CodeIgniter 2.1 so I was able to remove all that junk from my .htaccess - thanks. It works perfectly on my personal XAMPP stack and it now looks like this: Code: <IfModule mod_rewrite.c> It definitely needs to be <IfModule mod_rewrite.c>. If I change it to mod_rewrite.so, it doesn't work at all. I think the problem is definitely in my apache configuration. It might be something in the vhost.conf file, or it might be something in the httpd.conf file. I'm not really sure, and it doesn't help that I'm a n00b at apache. Based on my research I do think it is something to do with AllowOverride, but I'm just not sure what. It may need to be in a <Directory> bracket. I'm not completely sure. Need to do more research but if you guys can point me in the right direction that would be awesome. Can't seem to remove "index.php" from URLS on my new server? It's a server configuration issue that I can't figure out! - El Forum - 03-02-2012 [eluser]skcin7[/eluser] I figured it out. It was a setting with my apache configuration. My .htaccess file wasn't being read whatsoever. I had to locate my httpd.conf file and change AllowOverride to "ALL" |