Can access Drupal home page only - apache

I install a Drupal web site on my localhost but I only can access the home page. Other pages I can't access.
Error:
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.5.38
What am I doing wrong?

Most likely this is an Apache issue. Please uncomment the following line in Drupal's root .htaccess.
RewriteBase /
# If your site is running in a VirtualDocumentRoot at http://example.com/,
# uncomment the following line:
# RewriteBase /

Related

How to enable Virtual Host on Xampp for Laravel 5.8

I have problem with creating virtual host. I am using Windows 7 x64 Professional.
When i try click on any admin menu dashboard got this error:
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Apache/2.4.39 (Win64) OpenSSL/1.1.1c PHP/7.3.6
And in file C:\xampp-x64-7.3.6-1-VC15\apache\conf\extra\httpd-vhosts.conf I have this:
DocumentRoot "C:\xampp-x64-7.3.6-1-VC15\htdocs\gametrade150.lt\public"
ServerName gametrade150.lt
And of course I have restared my Apache server after adding this lines in those files.

How to show custom 404 error page when using `AllowEncodedSlashes On`

I recently came across the AllowEncodedSlashes Apache directive:
https://intranet.csc.liv.ac.uk/manual/mod/core.html#AllowEncodedSlashes
If I hit a URL like this: www.domain.com/my/page/%2F/etcetera, Apache shows its default 404 error page:
However, I would like to return a custom 404 error page but how can I do it within my .htaccess? This doesn't work:
ErrorDocument 404 /entrypoint.php
I know I can do it if I have access to the server's httpd.conf configuration file (I tested locally). But what if I do not have access to the configuration on a remote site? Is there a way?
Thank you for the attention.

Forcing localhost to use https results in a 403 error

I am working on a php website. I am working on it using Aptana with XAMPP. I recently changed my htaccess file to force my site to use https on the localhost. I haven't yet implemented a ssl certificate. When I try to access a webpage now, I am directed to a page that says:
Object not found!
The requested URL was not found on this server. If you entered the URL
manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.10 (Unix) OpenSSL/1.0.1j PHP/5.6.3 mod_perl/2.0.8-dev Perl/v5.16.3
I found some solutions to this but I really want to know why this is occurring. I know that I can change the httpd.conf file to fix it but I still don't understand what is happening.

Strange .htaccess ErrorDocument Error

i have the following line in my .htaccess file which is situated on my PC at G:/xampp/htdocs/project/public_html/.htaccess
ErrorDocument 404 /404.html
So when I enter any non-valid address, for example http://localhost/project/public_html/blabla , the following message appears:
Not Found
The requested URL /project/public_html/blabla was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 Server at localhost Port 80
But this is not my 404.html page!
But when I edit the ErrorDocument Syntax and include full link, i.e. make it:
ErrorDocument 404 http://localhost/project/public_html/404.html
but this redirects non existing links correctly to 404.html, but redirection is not what i want! I want a simple 404 error page!
Also one more strange thing is, when I remove the line completely from the .htaccess file, the error changes to this:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
1/4/2013 4:27:46 PM
Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
creepy, eh? so could someone help me out and tell me whats going on please?
/ references the web root, so your paths don't quite make sense. Either move the file to the web root, or change the path to reflect the path relative to the web root. (Either move the file to /xampp/htdocs, or change the path to /project/public_html/404.html.)

htaccess deny from all gets apache server test page

I have installed zpanel with centos 6.3.
Now what is the problem.
I have added domain mydomain.com and I have added blank index.php file.
I added too .htaccess file with "deny from all"
Now when I open the page in the browser, I get Apache 2 Test Page instead 403 Forbidden
But if I open http://mydomain.com/index.php, now I get 403 Forbidden.
I tried to edit the apache config file Directoryindex but there is no positive result. Anyone can help me?
Try to disable the default Apache CentOS welcome page:
#
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL. To disable the Welcome page, comment
# out all the lines below.
#
<LocationMatch "^/+$">
Options -Indexes
ErrorDocument 403 /error/noindex.html
</LocationMatch>
Edit file /etc/httpd/conf.d/welcome.conf and comment everything. Simply removing the welcome.conf file (or renaming it as .conf.disabled for example) should do the trick too.
Then, reload apache configuration (service httpd restart) and things should work as expected.
Same problem, when apache has been updated, the file welcome.conf has been created.
I've renamed it to disable it and now I get to see the Forbidden page for my Deny from all directives