0

I have deployed a server apache in ubuntu 16.04 which is devided in some virtual hosts.

I want to get rid of index.php in the url but I cant get my htaccess to work I will be deeply great-full for any help I can receive. I prefer to solve the problem in htaccess and not in apache itself because there are also other configurations I need to include in htaccess

Conf file

<VirtualHost *:80>
    <Directory var/www/cartwebs.com/public_html>              
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride All
                    Order allow,deny
                    allow from all          
    </Directory>
           ServerAdmin iosef@cartwebs.com
           ServerName cartwebs.com
           ServerAlias www.cartwebs.com
           DocumentRoot /var/www/cartwebs.com/public_html
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>

htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    #RewriteBase /

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [QSA,L]
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://www.cartwebs.com/$1 [L,R=301]

</IfModule>
Azim Saiyed
  • 392
  • 1
  • 5
  • 15
Iosef
  • 37
  • 10
  • Have you enabled mode_rewrite? check this https://stackoverflow.com/questions/12202387/htaccess-not-working-apache – Samuel James Oct 06 '17 at 04:05
  • Yes I did. Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all – Iosef Oct 06 '17 at 13:23

0 Answers0