rewrite url not working on ubuntu localhost in php
I have the file called call_center_interface.php
Options +FollowSymLinks
RewriteEngine on
R开发者_Go百科ewriteRule call_center_interface-act-(.*)\.htm$ call_center_interface.php?act=$1
i use the above url rewrite code but it is not working in ubuntu
Have you enabled the mod_rewrite module in apache? Run it as root or use sudo:
sudo a2enmod rewrite
There is any other rewrite rule that is working?
I would also recommend to place your code between
<IfModule mod_rewrite.c>
...
</IfModule>
otherwise on some servers you'll run into a 500-Server-Error-Page.
If you add a RewriteBase statement with the directory or subdirectory below your document root, you're also more safe (say: /var/www/foo/scripts/call_... and /var/www/foo is your document root, add 'RewriteBase "/scripts/"'.
精彩评论