Sadly, I can't make it work in Linux (Xubuntu 9.04), it always shows Page Not Found Error. But it works well in Windows. Are there any particular settings that I must configure at apache2.conf before I can start using .htaccess ? Any help would be greatly appreciated.
I could also not get the url rewrite to work using urlManager.
This is how my .htaccess looks like, it does not hide but I do not put index.php=r in my url:
## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks
IndexIgnore /
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php?r=$1
What's your OS ? Linux, Mac, or Windows ?
I used the given .htaccess at the tutorial, and it works fine in Windows LAMP Server (default installation with no additional settings). But in Xubuntu 9.04 or in Linux, it does not work, so I guess there must be some setting to be set first in the apache configuration file in order to read .htaccess. But I am not sure…
mod_rewrite might not be running with apache. When you say you are running Lamp I assume you are running this form your home server and therefore have control over it.
If using a Debian/*buntu server you can enable this module by running
mod_rewrite might not be running with apache. When you say you are running Lamp I assume you are running this form your home server and therefore have control over it.
If using a Debian/*buntu server you can enable this module by running
Then restart Apache and try again.
@dubby: Thanks, I have done what you have told me, but still I got Page Not Found error. Any other ideas ? Because I am new in Linux, and right now, I am feel kinda stuck.
Did you install in the web root folder of your Vhost? If not, try to set RewriteBase. E.g. if your app is reached with http://example.com/myapp/index.php:
Did you install in the web root folder of your Vhost? If not, try to set RewriteBase. E.g. if your app is reached with http://example.com/myapp/index.php:
@Mike: Thank you! What's a VHost by the way ?
But I have found another way to make the url rewrite works in Linux, I do not know if this is the correct one to do it but it works for me: