Welcome Guest, Not a member yet? Register   Sign In
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!
#1

[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>
RewriteEngine On
RewriteBase /

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
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>

This is what my vhost.conf apache file looks like (I think the problem might be in here)

Code:
NameVirtualHost *:80

<VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName nmwebstudio.com
        ServerAlias www.nmwebstudio.com
        DocumentRoot /srv/www/nmwebstudio.com/public_html/
        ErrorLog /srv/www/nmwebstudio.com/logs/error.log
        CustomLog /srv/www/nmwebstudio.com/logs/access.log combined
</VirtualHost>

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. Smile


Messages In This 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! - by El Forum - 02-29-2012, 05:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB