Welcome Guest, Not a member yet? Register   Sign In
(Found a solution !!!) Problem .htaccess and URLs (hosting ExtMedia.com)
#1

[eluser]Olf[/eluser]
I have a problem with URLs for hosting extmedia.com

My settings:

.htaccess
Code:
AddDefaultCharset utf-8

<IfModule !mod_rewrite.c>
   ErrorDocument 404 /index.php
   ErrorDocument 403 /index.php
</IfModule>

<IfModule mod_rewrite.c>

Options +FollowSymLinks
Options -Indexes

DirectoryIndex index.php

RewriteEngine on

RewriteBase /

RewriteCond $1 !^(index\.php|images|robots\.txt|public)
RewriteCond %{REQUEST_URI} !\.(css¦js¦jpg¦jpeg¦png¦gif)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L,QSA]

</IfModule>

config.php
Code:
$config['base_url']    = "http://site.ext/";
$config['index_page'] = "";
$config['uri_protocol']    = "AUTO";

The problem is the following:
site.ext - ok
site.ext/controller - forwards in site.ext (sometimes you can make and error 500)
site.ext/controller/function - error 404

If "ORIG_PATH_INFO", then URLs in the line changes, and a master controller.

Hosted suggests that the bug in the code CI.

Moving to another site hosting and on the local server and it works great.

I use CI 1.7

I suppose that I should make a difference in. Htaccess, but what?
See also:
http://test.gospel.by
http://test.gospel.by/main
http://test.gospel.by/main/view/222
http://test.gospel.by/main/view
#2

[eluser]bitist[/eluser]
Insteaf of this:
Code:
$config['uri_protocol']    = "AUTO";

try this one:
Code:
$config['uri_protocol']    = "REQUEST_URI";
#3

[eluser]Olf[/eluser]
Code:
$config['uri_protocol']    = "REQUEST_URI";

http://test.gospel.by - ok
http://test.gospel.by/main - error 500
http://test.gospel.by/main/view/222 - error 404
http://test.gospel.by/main/view - - error 404

Sad

I first tried different options with $config['uri_protocol']
#4

[eluser]Olf[/eluser]
Assuming that the code CI everything is in order. And in the other host (including local) and it works. I assume that the problem in adjusting .Htaccess
#5

[eluser]kRON[/eluser]
You sure your .htaccess is being parsed? I'm no expert and it may be a dumb suggestion, but try adding 'DirectoryIndex yarr.php' and see if you get the index page displayed if you rename 'index.php' to 'yarr.php'.

It could also be the case that 'AllowOverride' is disabling some options, although the 500 would rather indicate that somethings wrong with the URL wiring.
#6

[eluser]Olf[/eluser]
index.php -> rename -> eee.php

Code:
AddDefaultCharset utf-8

<IfModule !mod_rewrite.c>
   ErrorDocument 404 /index.php
   ErrorDocument 403 /index.php
</IfModule>

<IfModule mod_rewrite.c>

Options +FollowSymLinks
Options -Indexes

DirectoryIndex eee.php

RewriteEngine on

RewriteBase /

RewriteCond $1 !^(eee\.php|images|robots\.txt|public)
RewriteCond %{REQUEST_URI} !\.(css¦js¦jpg¦jpeg¦png¦gif)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /eee.php?/$1 [L,QSA]

</IfModule>

Result old Sad

See phpinfo() - can be thought?


Perhaps the problem because of the "register_globals = ON"?
Tried to disable through .htaccess write php_flag register_globals off
The server returned an HTTP 500 error
#7

[eluser]Olf[/eluser]
Found a solution to the problem
It's setting register_globals. It found "register_globals = on" for this reason that did not work URLs.

On my hosting solution has been simple.
Instead PHP4 need to use PHP5 - it is configured as "register_globals = off".

Code:
AddHandler x-httpd-php5  .php

AddDefaultCharset utf-8

Options +FollowSymLinks
Options -Indexes

DirectoryIndex index.php

RewriteEngine on

RewriteBase /

RewriteCond $1 !^(index\.php|images|robots\.txt|public)
RewriteCond %{REQUEST_URI} !\.(css¦js¦jpg¦jpeg¦png¦gif)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [NC,L,QSA]

Thank you all!




Theme © iAndrew 2016 - Forum software by © MyBB