I used this method for 3 websites that do have a domain name and everything is working perfectly fine. Currently I am developing another website which has NO domain name yet but is purely accessible through server IP so:
195.111.111.111/mywebsite.com/
instead of http://mywebsite.com/
You get the point I guess :) anyways, all websites share the same upload folder due to the fact that it has 300.000+ photo's in it and I didnt wanted to upload multiple copies.
It works flawless for all websites except this one without domain name, I guess it works different.
When I go to:
195.111.111.111/mywebsite.com/product-image
I just get an error in my php file that the require once cannot be found, which is obviously correct but the point is... my PHP shouldnt even be able to get a request from this URL since I have an Alias, yet it goes to PHP.
Can anyone tell me what I did wrong? my current config file is below:
ServerAdmin webmaster@localhost
DocumentRoot /var/www/mywebsite.nl/
#ServerName mywebsite.nl
#ServerAlias www.mywebsite.nl
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias "/product-image" "/var/www/uploads"
<Directory /var/www/mywebsite.nl/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =mywebsite.nl [OR]
RewriteCond %{SERVER_NAME} =mywebsite.nl
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]