.htaccess - Redirect with htaccess on apache -


i trying create virtualhost , allow htaccess redirect (it laravel project).
environment is: ubuntu16.04 apache2.4.18 php7.0.4

and here /etc/apache2/sites-available/sub.domain.com.conf

<virtualhost *:80>     servername eatec.es     serveralias webs.eatec.es      serveradmin eloy@eatec.es     documentroot /var/www/html/sub.domain.com/public     <directory "/var/html/sub.domain.com/public">             options followsymlinks multiviews             allowoverride             order allow,deny             allow     </directory>     #errorlog ${apache_log_dir}/error.log     #customlog ${apache_log_dir}/access.log combined  </virtualhost> 

things tried (and remember).
1. line of directory tried removing quotes.
2. line of directory used (removing subdomain sub -with , without quotes-).
3. move directory block file /etc/apache2/apache2.conf (i paste last of type of blocks).
4. change allowoverride option on block (on apache2.conf -with directory block in apache.conf on sub.domain.com.conf-).
5. there more micro changes, sure... don´t remember.

one more thing tried a2enmod rewrite doesn´t work (though see mod_rewrite on loaded modules if make phpinfo()).

this .htaccess content:

<ifmodule mod_rewrite.c>     <ifmodule mod_negotiation.c>         options -multiviews     </ifmodule>      rewriteengine on      # redirect trailing slashes if not folder...     rewritecond %{request_filename} !-d     rewriterule ^(.*)/$ /$1 [l,r=301]      # handle front controller...     rewritecond %{request_filename} !-d     rewritecond %{request_filename} !-f     rewriterule ^ index.php [l]      # handle authorization header     rewritecond %{http:authorization} .     rewriterule .* - [e=http_authorization:%{http:authorization}] </ifmodule> 

it default htaccess file on laravel project. supposed redirect index.php on same folder. folder structure next:
/var/www/html/sub.domain.com-------------> project
/var/www/html/sub.domain.com/public---> htaccess , index.php

any suggestion?? thanks.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo