Part of the EllisLab Network
   
2 of 2
2
htaccess is not working
Posted: 26 June 2008 06:26 AM   [ Ignore ]   [ # 16 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  426
Joined  10-22-2007

Rewrite_Module : Enabled
I know..still
check your rewritemod it may be off..try to enable that.

or switch to wamp

 Signature 

Blogmer - Open source blogging software based on codeigniter
Blogmer Documentation
Web Design company and FREE PHP MySQL Webhosting

Profile
 
 
Posted: 26 June 2008 06:31 AM   [ Ignore ]   [ # 17 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  489
Joined  06-06-2007
hcvitto - 26 June 2008 10:23 AM

i changed
RewriteBase CodeIgniter/

but now i got an error 500 on all pages..

What do the apache error logs say?

Try:
RewriteBase /CodeIgniter/

Profile
 
 
Posted: 26 June 2008 06:33 AM   [ Ignore ]   [ # 18 ]  
Summer Student
Total Posts:  14
Joined  06-26-2008

mmh..rewritemod is on..
about wamp, i already spent time on xampp, i’m afraid i got not much time to start all over again..thanx anyway

Profile
 
 
Posted: 26 June 2008 06:41 AM   [ Ignore ]   [ # 19 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  489
Joined  06-06-2007
hcvitto - 26 June 2008 10:33 AM

mmh..rewritemod is on..
about wamp, i already spent time on xampp, i’m afraid i got not much time to start all over again..thanx anyway

What causes the 500 error? What do the log files say?

Profile
 
 
Posted: 26 June 2008 06:54 AM   [ Ignore ]   [ # 20 ]  
Summer Student
Total Posts:  14
Joined  06-26-2008

[Thu Jun 26 12:47:59 2008] [error] [client 127.0.0.1] File does not exist: C:/Programmi/xampp/htdocs/CFIDE
[Thu Jun 26 12:52:11 2008] [alert] [client 127.0.0.1] C:/Programmi/xampp/htdocs/CodeIgniter/.htaccess: RewriteBase: argument is not a valid URL, referer: http://localhost/CodeIgniter/index.php/

this is the error form Apache log file

Profile
 
 
Posted: 26 June 2008 07:07 AM   [ Ignore ]   [ # 21 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  489
Joined  06-06-2007
hcvitto - 26 June 2008 10:54 AM

[Thu Jun 26 12:47:59 2008] [error] [client 127.0.0.1] File does not exist: C:/Programmi/xampp/htdocs/CFIDE
[Thu Jun 26 12:52:11 2008] [alert] [client 127.0.0.1] C:/Programmi/xampp/htdocs/CodeIgniter/.htaccess: RewriteBase: argument is not a valid URL, referer: http://localhost/CodeIgniter/index.php/

this is the error form Apache log file

It tells the url is incorrect. Try(different approach):

<IfModule mod_rewrite.c>
  
RewriteEngine On
  RewriteBase 
/
  
RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond 
%{REQUEST_FILENAME} !-d
  RewriteRule 
^(.*)$ /CodeIgniter/index.php/$1 [L]
</IfModule

or try setting
RewriteBase http://localhost/CodeIgniter/

Profile
 
 
Posted: 26 June 2008 08:00 AM   [ Ignore ]   [ # 22 ]  
Summer Student
Total Posts:  3
Joined  06-25-2008

FINALLY got it to work. I tried every combination of every idea mentioned in this thread. I have CI in my root directory, mod_Rewrite on. Here’s what worked for me:
I used the .htaccess file quoted below
I changed my config.php so that my $config[‘base_url’]  = “http://full.domain.name.com/index.php/”
And I set the $config[‘index_page’] = “”;

What finally made it work was putting the whole path in my base_url config setting. Hope this helps some one!

ZeEsHaN RaSoOL - 26 June 2008 03:33 AM

Yar ! i think you have to check this code. Save it wirh .htaccess but remove ‘index.php’ from your config.php file

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

Hope you will get it.
...............JaMzEe

Profile
 
 
Posted: 26 June 2008 08:32 AM   [ Ignore ]   [ # 23 ]  
Summer Student
Total Posts:  14
Joined  06-26-2008

great, it works for me too!!

here my .htaccess code

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /CodeIgniter/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /CodeIgniter/index.php/$1 [L]
</IfModule>
<IfModule mod_security.c>
  SecFilterEngine Off
  SecFilterScanPOST Off
</IfModule>

thanks to everybody
vitto

Profile
 
 
Posted: 01 October 2008 03:59 AM   [ Ignore ]   [ # 24 ]  
Summer Student
Total Posts:  5
Joined  10-01-2008

I’m using XAMPP. The following worked for me:

$config['base_url'"http://127.0.0.1/rootfolder/"
$config['index_page'""

Then in .htaccess:

Options +FollowSymLinks 
Options 
-Indexes 
DirectoryIndex index
.php 
RewriteEngine on 
RewriteCond 
$!^(index\.php|resources|images|css|js|robots\.txt|favicon\.ico
RewriteCond %{REQUEST_FILENAME} !-
RewriteCond 
%{REQUEST_FILENAME} !-
RewriteRule 
^(.*)$ index.php?/$1 [L,QSA] 

I also configured apache to allow rewriting.

Profile
 
 
Posted: 01 November 2008 01:14 PM   [ Ignore ]   [ # 25 ]  
Summer Student
Total Posts:  1
Joined  11-01-2008

I also had big problems with the site links in the production environment (on the public host server) - URL not found… error 500 internal server error etc.

In my case the troubles were with URL strings and the web server itself.

It turns out that some web servers just do not allow a URL like ...index.php/something
It has to be like this to work: ...index.php?something
So, you should change the RewriteRule like this:

RewriteRule ^(.*)$ /index.php?$1 [L,QSA]

and everything runs fine now.

domfosnz - 01 October 2008 07:59 AM

I’m using XAMPP. The following worked for me:

$config['base_url'"http://127.0.0.1/rootfolder/"
$config['index_page'""

Then in .htaccess:

Options +FollowSymLinks 
Options 
-Indexes 
DirectoryIndex index
.php 
RewriteEngine on 
RewriteCond 
$!^(index\.php|resources|images|css|js|robots\.txt|favicon\.ico
RewriteCond %{REQUEST_FILENAME} !-
RewriteCond 
%{REQUEST_FILENAME} !-
RewriteRule 
^(.*)$ index.php?/$1 [L,QSA] 

I also configured apache to allow rewriting.

Profile
 
 
Posted: 07 January 2009 09:10 AM   [ Ignore ]   [ # 26 ]  
Grad Student
Rank
Total Posts:  76
Joined  06-03-2008

i dont get it working. i always get a 404. no matter what i write into the .htaccess
is there no way to test if the .htaccess is loaded?
my CI is under
d:\htdocs\clipr

my url, which i m trying to connect to is:
http://localhost:8502/clipr/cms/welcome

the log in the apache error.log:
File does not exist: D:/htdocs/clipr/cms

Profile
 
 
Posted: 10 July 2010 10:13 AM   [ Ignore ]   [ # 27 ]  
Summer Student
Total Posts:  2
Joined  07-05-2010

Hi Zeeshan Rasool.
Thanks for the lines you posted ages before smile
Worked for me.
Thanks

Profile
 
 
Posted: 13 July 2010 05:10 AM   [ Ignore ]   [ # 28 ]  
Summer Student
Total Posts:  1
Joined  07-13-2010
hcvitto - 26 June 2008 12:32 PM

great, it works for me too!!

here my .htaccess code

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /CodeIgniter/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /CodeIgniter/index.php/$1 [L]
</IfModule>
<IfModule mod_security.c>
  SecFilterEngine Off
  SecFilterScanPOST Off
</IfModule>

thanks to everybody
vitto


thanks it works for me.. ^_^

Profile
 
 
Posted: 13 July 2010 05:56 AM   [ Ignore ]   [ # 29 ]  
Summer Student
Total Posts:  4
Joined  07-09-2010

Hi everyone!
I’m having also problems… I’m using Xampp and I have mod_rewrite enabled.
The thing is that I want to use this type of URLs :

http://localhost/test/ict-j/page4.html

So my RewruteRule is :

RewriteRule ^(.+)-j/page([0-9]*)\.html$ index.php?/landing/getInfo/$1/$2 [L,QSA]

And these are my settings :

.htaccess :

Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)-j/page([0-9]*)\.html$ index.php?/landing/getInfo/$1/$2 [L,QSA]

and config.php :

$config[‘base_url’]  = “http://127.0.0.1/test/”;

/*
|—————————————————————————————————————
| Index File
|—————————————————————————————————————
|
| Typically this will be your index.php file, unless you’ve renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
*/
$config[‘index_page’] = “”;
$config[‘uri_protocol’]  = “REQUEST_URI”;

With this configuration I’m getting 404 Page not found :( .

I hope somebody could help me
Thnx

Profile
 
 
Posted: 28 April 2012 06:45 AM   [ Ignore ]   [ # 30 ]  
Summer Student
Total Posts:  1
Joined  04-26-2012
domfosnz - 01 October 2008 03:59 AM

I’m using XAMPP. The following worked for me:

$config['base_url'"http://127.0.0.1/rootfolder/"
$config['index_page'""

Then in .htaccess:

Options +FollowSymLinks 
Options 
-Indexes 
DirectoryIndex index
.php 
RewriteEngine on 
RewriteCond 
$!^(index\.php|resources|images|css|js|robots\.txt|favicon\.ico
RewriteCond %{REQUEST_FILENAME} !-
RewriteCond 
%{REQUEST_FILENAME} !-
RewriteRule 
^(.*)$ index.php?/$1 [L,QSA] 

I also configured apache to allow rewriting.

Hi yes this works for me as well. I am using Xampp.

 Signature 

Whoever wins, i win

Profile
 
 
   
2 of 2
2