Apache shows it works page even if i change the path of document root

My Probleme, is when i put wordpress.local.fr, to display welcome page of my wordpress, it shows me always it works page.

enter image description here

Read More

but when i make wordpress.local.fr/wordpress it works

enter image description here

and this is what i have done :

Ip Adresse of ubuntu server : 192.168.52.130

In etc/apache2/sites-available/wordpress

<VirtualHost *:80>
    ServerAdmin wordpress.local.fr
    DocumentRoot /var/www/wordpress
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

etc/hosts :

192.168.52.130 wordpress.local.fr
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

hosts windows :

192.168.52.130 wordpress.local.fr

wordpress folder contain all my files there is no children folder and i have used samba to share /var/www/ between windows and ubuntu server

[Share]
  comment = Shared
  path    = /var/www/
  browseable = yes
  read only = no
  guest ok = yes
  writeable = yes

I don’t know where I am going wrong.
what can i check and change ?

Edit

I have tried to make just a txt file in fileindex folder instead my wordpress project and making in DocumentRoot /var/www/fileindex always i have the it works page so the DocumentRoot is not taken into account

my htaccess file (in my wordpress/ folder) it was :

# BEGIN WordPress
# END WordPress

I have edited my htaccess file (in my wordpress/ folder). to that :

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

I have changed my serverAdmin to serverName like that :

<VirtualHost *:80>
    ServerName wordpress.local.fr
    DocumentRoot /var/www/wordpress/
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

after restarting my apache it still the same probleme

Thanks by advance

Related posts

2 comments

  1. In your config I’m seeing

    ServerAdmin wordpress.local.fr
    

    ServerAdmin directive is for emails to receive when Apache hits error, it should be

    ServerName wordpress.local.fr
    
  2. It seems like you need to update your .htaccess file (in your wordpress/ folder).

    Change RewriteBase from / to /wordpress/.

    Have fun!

Comments are closed.