sensibull
By:
sensibull

404 Error in Wordpress Posts & .htaccess Help!

July 19, 2015 1.7k views
Apache CMS Ubuntu

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

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

Have another answer? Share your knowledge.