Welcome Guest, Not a member yet? Register   Sign In
problem with .htaccess an DOCUMENT_ROOT
#1

[eluser]dexter21[/eluser]
Hi, i've recently finished a project with ci. Now i want to redirect with .htaccess . my phpinfo said that i've load mod_rewrite module. My DOCUMENT_ROOT is /usr/clients and the project is in /usr/clients/client1 . i put a .htaccess file with following content in /usr/clients/client1/


Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|imgs|tmp|public|downloads|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

but when i call to http://myserver/client1/contact.html i get

Not Found

The requested URL /client1/contact.html was not found on this server.


and dont get error of .htaccess file. any help plz?
#2

[eluser]parrots[/eluser]
Try this:

Code:
RewriteEngine on
RewriteBase /client1/
RewriteCond $1 !^(index\.php|images|imgs|tmp|public|downloads|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

RewriteBase is helpful when you're not running in the root of a domain.

Also make sure in config.php you've set $config['index_page'] to "" and $config['url_suffix'] to ".html" (since it looks like you want all your pages to have the extension .html).
#3

[eluser]dexter21[/eluser]
many thanks but nothing has changed, same error.
#4

[eluser]exit[/eluser]
This should work:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|imgs|tmp|public|downloads|robots\.txt)
RewriteRule ^(.*)$ /client1/index.php/$1 [L]




Theme © iAndrew 2016 - Forum software by © MyBB