permalinks in WordPress not working on localhost but work perfectly on live server

前端 未结 6 1637
猫巷女王i
猫巷女王i 2021-01-26 10:50

I am getting problem of permalink in WordPress not works at localhost but perfectly work at server.I am also word press developer and get these problem many times.Can you please

6条回答
  •  孤街浪徒
    2021-01-26 11:20

    If you are using ubuntu system then you need to enable apache2 mod_rewrite for your setup. Try this command

    sudo a2enmod rewrite
    

    You will get message like below:

    Enabling module rewrite.
    To activate the new configuration, you need to run:
      service apache2 restart
    

    Now enter this command to restart your apache web-server.

    sudo service apache2 restart
    

    This should solve your problem. If the problem persist then you need to change apache config file (apache2.conf):

    $ sudo gedit /etc/apache2/apache2.conf
    

    Search for model for your localhost root directory path. Web-server root path may very based on your apache installed version. It might be or . Its mostly like following:

    
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
     
    

    Change AllowOverride None to AllowOverride All. Save and close the file. Restart your apache web-server

    sudo service apache2 restart
    

提交回复
热议问题