Apache virtual hosts and mod_rewrite problem
Hi to all,
I want to test mod_rewrite in my debian box. I have browsed through the net but still not able to make mod_rewrite to work. Below are the steps that I have followed:
1. I have enabled mod_rewrite module in Apache2 using a2enmod command.
2. I have created a file "www.mine.org" in /etc/apache2/sites-available with the following entries:
CustomLog /var/log/apache2/www.mine.org-access_log common
Allow from all
# Don't show indexes for directories
Options Indexes FollowSymLinks MultiViews
RewriteRule ^/articles/([0-9]+)$ /?article=$1 [PT]
3. I have enabled the site through the a2ensite command.
4. I have also have this entry in /etc/hosts:
127.0.0.1 localhost.localdomain localhost www.mine.org
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
I have entered "http://www.mine.org/articles/6" in my browser, I still got a 404 not found error :( I'm stumped on what to do next. Please help.
Thanks in advance.
looking at the access/error logs is always a good start - /var/log/apache2/
The only thing that jumps out at me is the [PT]. If you don't have another handler down the line, there is no need for passthrough. The article at debian-administration.com uses it for their cgi scripting - is that where you found this? :D
Yes, you're right, I copied the line from debian-administration.com :). I have googled the problem and visited many sites to look for the solution for this problem. I'll try later at home to disable the default virtual host site and also delete the [PT] (actually I have no idea what it does). If it still doesn't work and I'm fresh out of ideas, I'll try the one Apache releases.
Any more ideas guys?
The official mod_rewrite reference for rewrite rules is at http://httpd.apache.org/docs/2.0/mod...ml#rewriterule . I would have linked it before, as well as http://www.debian-administration.org/articles/136 - but I hadn't posted enough to be allowed to post URLs.
|All times are GMT -5. The time now is 03:54 AM.|