Redirect all traffic to index.php using mod_rewrite

前端 未结 5 1162
Happy的楠姐
Happy的楠姐 2020-11-28 14:29

I\'m trying to build a url shortener, and I want to be able to take any characters immediately after the domain and have them passed as a variable url. So for example

5条回答
  •  忘掉有多难
    2020-11-28 15:18

    ByTheWay don't forget to enable mod rewrite,in apache on ubuntu

    sudo a2enmod rewrite 
    

    and then restart apache2

    sudo /etc/init.d/apache2 restart
    

    edit: it is an old question that helped me but I lost hours testing my apache2.conf file on one side and .htaccess file on the other side and still no light.

提交回复
热议问题