LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mod_rewrite settings httpd.conf file (https://www.linuxquestions.org/questions/linux-newbie-8/mod_rewrite-settings-httpd-conf-file-4175575419/)

koby82 03-20-2016 09:51 AM

Mod_rewrite settings httpd.conf file
 
Hi All,

I would appreciate if some could give me some help.

I'm on Centos, and after installing and configuring Wordpress, everything works fine, until the Permalinks - URL rewrite feature...

I always receive 404 URL error on my internal pages...

This is how my httpd.conf file looks like at the mod_rewrite:


"
# 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 none

#
# Controls who can get stuff from this server.
#
Require all granted
"


I know that "AllowOverride" should be set to "All", but when I set this to All, the default Apache page appears only on my index page...

My .htaccess looks like:

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

# END WordPress"

Are there any other configuration steps to be done?

Thank You!

hydrurga 03-21-2016 03:23 AM

Your .htaccess looks fine. However, you do need to set an override at some point for the .htaccess to be taken into account.

What does your DocumentRoot directory entry look like in httpd.conf?

Can you please explain what you mean by this line?

Quote:

I know that "AllowOverride" should be set to "All", but when I set this to All, the default Apache page appears only on my index page...

koby82 03-21-2016 12:39 PM

Hi hydrurga

Thanks for your reply.

I've only added the following line into my .htaccess:

Options Indexes FollowSymLinks

And it does work now...I can't explain why and how...but it works..

And with this, I mean:

Can you please explain what you mean by this line?

Quote:
I know that "AllowOverride" should be set to "All", but when I set this to All, the default Apache page appears only on my index page...


- I've set the main directory /var/www/ -> to Allowoverride All, and at that moment I received only the main Apache page when trying to access the website. It looked, as the domain root folder being empty...


All times are GMT -5. The time now is 08:22 AM.