doudang8824 2013-11-13 22:07
浏览 71

URL重写不起作用(ubuntu13.10 / apache2.4.6)

I need your help! (sorry for my bad english)

I try to do url rewriting in my localhost on Ubuntu13.10/Apache2.4.6 ... I searched a lot of time on internet and problem is always here..

this is my .htaccess (I begin in url rewriting so I don't know if it's ok) :

RewriteEngine On
AllowFromAll All
RewriteRule home/   index.php?uc=home

and when I go to 127.0.0.1/mywebsite/home/ I have a 404 error.

  • My .htaccess is in : mywebsite/.htaccess
  • I activated url rewrite with "sudo a2enmod rewrite" and restarted apache.
  • I have no error in apache logs
  • I read solution who said I have to change AllowOverride to On in /etc/apache2/sites-available/default but I dont have /etc/apache2/sites-available/default file
  • I am lost...

Please, I don't know what to do...

After many tests : I think I have a problem of AllowOverride

  • 写回答

3条回答 默认 最新

  • douhe4336 2013-11-13 22:09
    关注

    You either need to specify the RewriteBase

    RewriteBase /mywebsite/
    RewriteRule home   index.php?uc=home [L]
    

    or add it to your rule

    RewriteRule /mywebsite/home   index.php?uc=home [L]
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?