Support » Localhost Installs » localhosting a wordpress website in linux PC, content pages shows error page

  • Resolved wjeong

    (@wjeong)



    Hi, I’m new to Linux. I’m currently using Rhel7.
    I was transferring a wordpress website to this Linux PC.

    When I go to [url]http://localhost/WEBSITE[/url], it will go to the front page (loads fine). However, when I click the content pages, or click the menu items, it will show = The requested URL /index.php was not found on this server.

    These are the current versions.
    Apache -2.4.6 / PHP -5.6.31 / mysql -14.14 Distrib 5.6.37, for Linux (x86_64)
    ‚óŹ mysqld.service – MySQL Community Server

    /var/www/html/WEBSITE/ group permission = APACHE

    This is the .htaccess file in local

    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    

    Thank you.

    • This topic was modified 10 months, 3 weeks ago by  wjeong.
    • This topic was modified 10 months, 3 weeks ago by  wjeong.
    • This topic was modified 10 months, 3 weeks ago by  wjeong.
    • This topic was modified 10 months, 3 weeks ago by  wjeong.
    • This topic was modified 10 months, 3 weeks ago by  wjeong.
    • This topic was modified 10 months, 3 weeks ago by  wjeong.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Steve Stern

    (@sterndata)

    Support Volunteer

    In your httpd configuration, add this

    <Directory /path/to/wordpress>
      AllowOverride All
    </Directory>

    Then restart httpd.

    /path/to/wordpress may be /var/www/html or wherever you installed WordPress

    Hi, Thank you for the reply.
    I think I’ve already did that I changed all AllowOverride None to All in httpd.conf file.

    It looks like this in current httpd.conf file.

    
    # Further relax access to the default document root:
    <Directory "/var/www/html">
        #
        # Possible values for the Options directive are "None", "All",
        # or any combination of:
        #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
        #
        # Note that "MultiViews" must be named *explicitly* --- "Options All"
        # doesn't give it to you.
        #
        # The Options directive is both complicated and important.  Please see
        # http://httpd.apache.org/docs/2.4/mod/core.html#options
        # for more information.
        #
        Options Indexes FollowSymLinks
    
        #
        # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   Options FileInfo AuthConfig Limit
        #
        AllowOverride All
    
        #
        # Controls who can get stuff from this server.
        #
        Require all granted
    </Directory>
    
    Moderator Steve Stern

    (@sterndata)

    Support Volunteer

    Just for a test, temporarily disable SELinux:

    sudo setenforce Permissive

    and see if it works.

    I typed that and restarted httpd, but no luck.

    I posted a question in LinuxQuestions earlier with the parts that I changed to solve this problem. This might give you overview of my situation.

    https://www.linuxquestions.org/questions/linux-newbie-8/localhosting-a-wordpress-website-url-index-php-was-not-found-on-this-server-when-i-click-contents-4175614611/

    • This reply was modified 10 months, 3 weeks ago by  wjeong.
    • This reply was modified 10 months, 3 weeks ago by  wjeong.

    Thank you for your help.

    I fixed it, I changed permissions in root user and it worked. I think I gave wrong permissions to httpd directories. I changed it back to normal, and restarted httpd.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘localhosting a wordpress website in linux PC, content pages shows error page’ is closed to new replies.