开发者

My mod_rewrite won't work, what's wrong?

开发者 https://www.devze.com 2022-12-23 09:25 出处:网络
I have开发者_如何学C the following rewrite rule, but nothing is hapenning at all when I try to use it. I have the file in the directory server.blahblahblah.com/todo and the following is my .htaccess f

I have开发者_如何学C the following rewrite rule, but nothing is hapenning at all when I try to use it. I have the file in the directory server.blahblahblah.com/todo and the following is my .htaccess file:

Options +FollowSymLinks
Options +Indexes

RewriteEngine On
RewriteBase /

RewriteRule ^tasks/view/([0-9]+)?/$ controller.php?task=view&id=$1
RewriteRule ^tasks/view/([0-9]+)\.xml$ controller.php?task=viewxml&id=$1
RewriteRule ^tasks/new?/$ controller.php?task=new
RewriteRule ^tasks/delete/([0-9]+)?/$ controller.php?task=delete&id=$1
RewriteRule ^tasks/completed/([0-9]+)?/$ controller.php?task=complete&id=$1
RewriteRule ^tasks?/$ controller.php?task=home

Does anyone know why this won't work at all?

Thanks,

Tim


If nothing happens at all, it might be that you didn't enable .htaccess files for your site. To do that, change your site configuration (/etc/apache2/sites-enabled/<yoursite>) to include AllowOverride All instead of AllowOverride None (the default). But mind the performance disadvantage - you could also put the rules directly in the site configuration.

In case that doesn't solve it, look at the Apache logs in /var/log/apache2/*.

0

精彩评论

暂无评论...
验证码 换一张
取 消