Welcome Guest, Not a member yet? Register   Sign In
htaccess doesnt work once uploaded to server
#1

[eluser]rossmurphy[/eluser]
Hi,

I'm getting this error when i navigate to http://www.mysite.com/pgs/home.

Quote:The requested URL /index.php/home was not found on this server.

But when i navigate to http://www.mysite.com/pgs/index.php/home it works. I know it has something to do with my .htaccess file. It works on my local server.

Here is my .htaccess.

Code:
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

Here is my config file:

Code:
$config['base_url'] = 'www.mysite.com/pgs';
$config['uri_protocol']    = "AUTO";

Anyone know why this wouldn't be working?

I have check mod rewrite is on.
#2

[eluser]wowdezign[/eluser]
I used to have the same problem until I found out how to set the "Rewrite base". I don't know if that is what's wrong with your s or not, but I work on a local server and then upload to a production server so on the local one I have something like:

Code:
RewriteEngine On
RewriteBase/foldername/www/

But then on the production server it changes to something like:

Code:
RewriteEngine On
RewriteBase /

Hope that helps.
#3

[eluser]rossmurphy[/eluser]
Thanks wowdesignz, it was the RewriteBase /.

Had to set it to:

Code:
RewriteBase /mysite/

Because the site is in a sub folder.
#4

[eluser]wowdezign[/eluser]
Great. I like to help where I can.




Theme © iAndrew 2016 - Forum software by © MyBB