virtualhost - Remove index.php in Wordpress subfolders when using virtual hosts -


i have looked everywhere find solution problem, nothing have tried has worked. when having permalink settings /index.php/%postname%/ works fine, when remove index.php part 404 , in log:

[tue aug 13 05:05:46 2013] [error] [client 202.58.198.84] file not exist: /var/www/html/domain1/postname, referer:..... 

i have red hat webserver running apache 2 wordpress sites through virtual hosts. virtual hosts this.

<virtualhost *:80>   # general   serveradmin info@domain1.com   documentroot /var/www/html/domain1   servername domain1.com   serveralias www.domain1.com    # logging   errorlog logs/domain1-error_log   customlog logs/domain1-access_log common </virtualhost> 

and

<virtualhost *:80>   # general   serveradmin info@domain2.com   documentroot /var/www/html/domain2   servername domain2.com   serveralias www.domain2.com    # logging   errorlog logs/domain2-error_log   customlog logs/domain2-access_log common </virtualhost> 

the .htaccess file in sub folders looks after changing permalink in frontend settings.

# 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 

i tried change

rewritebase / 

to

rewritebase /subfolder 

without luck.

this not huge problem bugs me lot! appreciate if had solution this.

make sure that:

  • your wordpress permalink settings set /%postname%
  • the .htaccess file placed inside /var/www/html/domain1 (same domain2)
  • you specify rules domain1/2 directory (add piece of code right before </virtualhost> tag inside configuration file):

    <directory /var/www/html/domain1>         options followsymlinks multiviews         allowoverride         order allow,deny         allow </directory> 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -