P
P
PP2015-05-27 09:08:01
PHP
PP, 2015-05-27 09:08:01

How to implement a "single entry point" without a domain?

hello, general problem. A site with a single point of entry is not launched by ip address. More precisely, it launches only a welcome page,
I'll try in more detail ...
There is Debian, Apache2 and a PHP site with a single entry point. the site is located in the /var/www/site folder.
There is no domain, so the request goes to %IP_ADDRESS%/site (the main page is launched),
but other requests (for example: %IP_ADDRESS%/site/controller/action) are redirected to a 404 page
and swears:
The requested URL /site/controller/action was not found on this server.
the site is operational, before that it worked with the domain, but without it, it doesn’t want to (
site configs in Apache

<VirtualHost *:80>
   ServerAdmin [email protected]
   DocumentRoot /var/www/site
   ServerName site.com
   ServerAlias www.site.kg
   ErrorLog /var/log/apache2/site.com-error.log
   CustomLog /var/log/apache2/site.com-access.log combined
         <Directory "/var/www/site/" >
                    Options -Indexes FollowSymLinks MultiViews
                    AllowOverride all
                    Order Deny,Allow
                    Allow from all
                    RewriteEngine On
                    RewriteBase /site
                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteCond %{REQUEST_FILENAME} !-d
                    RewriteRule .* index.php [L]
         </Directory>
</VirtualHost>

ln -s did
not know where to look. I really ask for help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Shaks, 2015-05-27
@shaks

> I don't know where to look. Please help me,
please take a look at:

DocumentRoot /var/www/site ( сайт находится в папке /var/www/site обращаться нужно -  %IP_ADDRESS%/ а не  %IP_ADDRESS%/site)
   ServerName site.com - стереть, вы же по ip обращаетесь,  причем тут site.com ?
   ServerAlias www.site.kg - стереть

look in the logs
ErrorLog /var/log/apache2/site.com-error.log
   CustomLog /var/log/apache2/site.com-access.log combined

make sure that the ip address does not open any other config that is loaded first into the apache config.
> (the main page starts up)
are you sure that 404 comes from Apache and not from a script?
The problem may be that a REST request is used, and the site is in a folder, and the routing of your site's script issues 404, because site/ perceives it as a route that is not configured for it. (you need to specify the base url somewhere in the scripts, it should be like this)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question