Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using a couple of rewrite directives that always works before on apache2 but now i'm trying new a shared hosting and the rewrite rules do not seem to get applied.

I've reduced the .htaccess files to the following essential rules:

RewriteEngine On
Rewritebase /demo/

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

As you can see, i want to rewrite every request to my index.php file in the demo folder from root.

So everything like http://www.example.com/demo/albums/show/1 should be processed by http://www.example.com/demo/index.php for a standard MVC setup. (I'm using CodeIgniter btw)

The directives above results in a 500 error, so i thought maybe because of some possible syntax differences between 1.3 and 2.x.

After some trail and error editing, i've found the rewrite rule itself to be at fault but i really don't understand why.

Any ideas to why my rewrite rule doesn't work? it did before on lots of different servers. Suggestions how to fix it?

Note: mod_rewrite does work, i've written a small test to be sure

share|improve this question
2  
Set RewriteLog and RewriteLogLevel so that you can see what mod_rewrite is actually doing. The reference documentation for 1.3 is at httpd.apache.org/docs/1.3/mod/mod_rewrite.html. –  James Sneeringer May 1 '10 at 16:47
    
@james thanks, good advice! ;-) –  Sander Versluys May 3 '10 at 11:46

2 Answers 2

Is RewriteBase capitalized correctly in the actual file?

Is the rule in the main part of httpd.conf or in a block where perhaps you don't need the initial slash / ?

share|improve this answer

Your .htaccess file seems to be in good condition, that should work with Apache 1.3.

How did you create your .htaccess? If my memory serves me right, Apache 1.3 was more sensitive about the linebreaks etc. than Apache 2.x is, so if you created the file with Windows Notepad or other editor using \r\n for newline, that might cause the internal server error.

If you have access to Apache error log, see there what's causing Apache to get upset.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.