mod_rewrite .htaccess alias wamp problem 500

New to mod_rewrite? This is a good place to start.

mod_rewrite .htaccess alias wamp problem 500

Postby kierzniak » Wed Jun 10, 2009 4:25 am

I'm user of zend framework and i want to use alias on my local server wamp. Hovewer i have some problem with my .htaccess this is code

Code: Select all
SetEnv APPLICATION_ENV development

AddDefaultCharset UTF-8

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]


When i try to access to index.php i have intenal server error. Intresting is when I navigate to higher directory i doesn't see the folder with index.php.
kierzniak
 
Posts: 3
Joined: Wed Jun 10, 2009 4:14 am

Postby richardk » Wed Jun 10, 2009 1:24 pm

What does your error log say the error is?

Try
Code: Select all
SetEnv APPLICATION_ENV development

AddDefaultCharset UTF-8

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-l
RewriteRule . /index.php [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby kierzniak » Fri Jun 12, 2009 6:39 am

Hmm ok now is working. In log error i have read that in .htaccess there should be option followsymlinks. When i add this i have internal server error. But i have changed the .htaccess for this one from your post and know is working. But! When i type e.g. http://localhost/revange/someid
There should be error message from zend framework tha i don't have this controller. But the browser redirect me to http://localhost/
kierzniak
 
Posts: 3
Joined: Wed Jun 10, 2009 4:14 am

Postby richardk » Fri Jun 12, 2009 8:49 am

In log error i have read that in .htaccess there should be option followsymlinks. When i add this i have internal server error.

Try
Code: Select all
Options +FollowSymLinks


But! When i type e.g. http://localhost/revange/someid
There should be error message from zend framework tha i don't have this controller. But the browser redirect me to http://localhost/

Does the URL change?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby kierzniak » Tue Jun 16, 2009 5:50 am

No, the url doesn't change.
kierzniak
 
Posts: 3
Joined: Wed Jun 10, 2009 4:14 am

Postby richardk » Tue Jun 16, 2009 10:36 am

Are you working in a sub directory?If you are replace
Code: Select all
/index.php

with
Code: Select all
./index.php


If not it doesn't sound like the problem is with the mod_rewrite.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 94 guests

cron