ubuntu 20.04 LTS Configure localhost to pass url to index.php
Budget: $10 – $30 USD
I am using ubuntu 20.04 LTS.
I need to test an application on an internal server that is not connected to the internet.
Normally I would test it with a domain, like domain.com, but now I will be using localhost.
So normally I would enter http://domain.com/A/AB/ABC/ABCD/index.html and index.php would receive A/AB/ABC/ABCD/index.html.
But now I want to be able to enter http://localhost/A/AB/ABC/ABCD/index.html and I want the server to give the information I entered to index.php.
So again index.php would receive A/AB/ABC/ABCD/index.html but now from localhost.
I have configured everything but it is not working.
My .htaccess file contains:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
/etc/apache2/apache2.conf contains:
<Directory /var/www>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/html>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
I also did:
# a2enmod rewrite
# service apache2 restart
But I am still getting an error in the browser:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. Apache/2.4.41 (Ubuntu) Server at localhost Port 80
And I also get an Apache error in /var/log/apache2/error.log:
[Mon Mar 27 18:44:09.655215 2023] [core:error] [pid 36688] [client ::1:34450] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
I need someone to tell me how to fix this.
Thanks
I need to test an application on an internal server that is not connected to the internet.
Normally I would test it with a domain, like domain.com, but now I will be using localhost.
So normally I would enter http://domain.com/A/AB/ABC/ABCD/index.html and index.php would receive A/AB/ABC/ABCD/index.html.
But now I want to be able to enter http://localhost/A/AB/ABC/ABCD/index.html and I want the server to give the information I entered to index.php.
So again index.php would receive A/AB/ABC/ABCD/index.html but now from localhost.
I have configured everything but it is not working.
My .htaccess file contains:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
/etc/apache2/apache2.conf contains:
<Directory /var/www>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/html>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
I also did:
# a2enmod rewrite
# service apache2 restart
But I am still getting an error in the browser:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. Apache/2.4.41 (Ubuntu) Server at localhost Port 80
And I also get an Apache error in /var/log/apache2/error.log:
[Mon Mar 27 18:44:09.655215 2023] [core:error] [pid 36688] [client ::1:34450] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
I need someone to tell me how to fix this.
Thanks