Closed theodotos closed 6 years ago
hi! sorry for not answering sooner: I was traveling :)
did you manage to solve the problem?
It could be the .htaccess file in the web folder can you show it?
Hi!
did you manage to solve the problem?
No, not yet. Here's how .htaccess looks like:
Outside webroot:
root@humanecosystems:~# cat /var/www/html/humanecosystems.example.com/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /HEv3/
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
Inside .webroot:
root@humanecosystems:~# cat /var/www/html/humanecosystems.example.com/webroot/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /HEv3/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
oh, I see the problem: you have
RewriteBase /HEv3/
which is used as the base of your URLs
but from what I see in your setup it is not this, right?
for example, you do not have the system accessible through something like:
http://humanecosystems.example.com/**HEv3**
you should put in RewriteBase the part of the URL that matches the root directory from which you can access the system from the http server. If it is in the root directory of the http server, then you can just put a slash /
try it out and let me know
It worked! \o/
My Apache VirtualHost configuration:
<VirtualHost *:80>
ServerName humanecosystems.cut.ac.cy
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>
<VirtualHost *:443>
ServerName humanecosystems.example.com
DocumentRoot /var/www/html/humanecosystems.example.com/
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/humanecosystems.cut.ac.cy.pem
SSLCertificateKeyFile /etc/apache2/ssl/humanecosystems.cut.ac.cy.key
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS
SSLHonorCipherOrder on
SSLCompression off
SSLOptions +StrictRequire
# Add vhost name to log entries:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined
LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common
<Directory /var/www/html/humanecosystems.example.com/>
AllowOverride All
</Directory>
</VirtualHost>
The AllowOverride All above is very important for .htaccess to work.
My .htaccess files:
Docroot:
root@humanecosystems:~# cat /var/www/html/humanecosystems.example.com/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
Webroot:
# cat /var/www/html/humanecosystems.example.com/webroot/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Thanks @xdxdVSxdxd
I am using my application was built using laravel and I am having a similar situation, my htaccess looks different from the one above. Here is mine. Can you kindly help me out. I don't know much about htaccess please. My website is www.stash.com.ng the page loads fine but every other page doesn't go through. It was hosted on digital ocean and Ubuntu 18.04 was used.
`
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
` I hope to get a response soon. Thanks in advance
If you are running on Ubuntu try sudo a2enmod rewrite then restart apache2
If you are running on Ubuntu try sudo a2enmod rewrite then restart apache2
thanks it work's
I am using my application was built using laravel and I am having a similar situation, my htaccess looks different from the one above. Here is mine. Can you kindly help me out. I don't know much about htaccess please. My website is www.stash.com.ng the page loads fine but every other page doesn't go through. It was hosted on digital ocean and Ubuntu 18.04 was used. `
Options -MultiViews -Indexes
RewriteEngine On
Handle Authorization Header
RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L]
` I hope to get a response soon. Thanks in advance
sudo nano /etc/apache2/apache.conf
Inside apache2.conf change <Directory /var/www/your_domain> Options Indexes FollowSymLinks AllowOverride None Require all granted To <Directory /var/www/your_domain> Options Indexes FollowSymLinks AllowOverride All Require all granted
I am trying to deploy my application was built using laravel but whenever i trying with ip it is showing this.
I had some progress on setting the system. Now I can see the frontpage but I get 404 errors on all the links I visit:
I have these modules enabled:
My Apache vhost:
Any idea?