Question

404 Error in Wordpress Posts & .htaccess Help!

Posted July 19, 2015 3.8k views
Ubuntu Apache CMS

Dear Friends,

I’m trying change rewrite files both in Apache file & Wordpress .htaccess. I’m following below guideline but not help.
Website is accessible but not the post and other pages.
Why?

https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite

Thank you,

root@XYZ:~$ sudo apt-get install apache2

[sudo] password for root:

Reading package lists... Done

Building dependency tree

Reading state information... Done

apache2 is already the newest version.

0 upgraded, 0 newly installed, 0 to remove and 69 not upgraded.

root@XYZ:~$ sudo nano /etc/apache2/sites-available/default
root@XYZ:~$ sudo service apache2 restart
 * Restarting web server apache2                                                
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

1 comment
  • Have you checked if you have set the permalinks properly?

    Also I assume that you have enabled mod-rewrite by running this command:

    sudo a2enmod rewrite
    

    Other than enabling mod-rewrite, you need to change your Apache config from

    AllowOverride None
    

    to

    AllowOverride All
    

    The above config can be found in /etc/apache2/apache.conf if you are on Ubuntu 14.04 or else it can be found in the /etc/apache2/sites-available/yoursitefile if you are on Ubuntu 12.04.


    Regards
    Saurabh

    Servopia.com
    Managed Cloud Hosting For PHP Applications On DigitalOcean IaaS

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

1 answer

This question was answered by @saurabh:

Have you checked if you have set the permalinks properly?

Also I assume that you have enabled mod-rewrite by running this command:

sudo a2enmod rewrite

Other than enabling mod-rewrite, you need to change your Apache config from

AllowOverride None

to

AllowOverride All

The above config can be found in /etc/apache2/apache.conf if you are on Ubuntu 14.04 or else it can be found in the /etc/apache2/sites-available/yoursitefile if you are on Ubuntu 12.04.


Regards
Saurabh

Servopia.com
Managed Cloud Hosting For PHP Applications On DigitalOcean IaaS

View the original comment

Submit an Answer