I locally setup a wordpress project by using a backup and the sub pages are not working in the project only giving the error message below eg- when i tried to go to the about us page it gives the below error in the browser
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
Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.2.26
It's look like server error, Please confirm that you have correctly setup vertual host.
Here is code to create virtual host.
On Xampp:
<VirtualHost wp.local:80>
DocumentRoot "D:\dev\wp"
ServerName wp.local
ServerAlias wp.local
<Directory "D:\dev\wp">
DirectoryIndex index.php
Require all granted
Allowoverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Related
just started with Symfony2 and already have a problem that i can not solve.
Installed the Symfony2 demo app on a VPS with debian. but trying to open it give me a "503 Service unavailable".
I used 'symfony demo' to install to /var/www/symfony_demo/
then added a symdemo.conf file to /etc/apache2/sites-available that look like this:
NameVirtualHost XX.XXX.XX.XXX
<VirtualHost XX.XXX.XX.XXX>
ServerName symblog.dev
DocumentRoot "/var/www/symfony_demo/web"
DirectoryIndex app.php
<Directory "/var/www/symfony_demo/web">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
XX.XXX.XX.XXX = public server IP
and activated it with a2ensite symdemo.conf
I thought that would work, but opening the IP give me the error message.
and trying to open app_dev.php give me not allowed to access this file
Could someone please give me a tip?
Nevermind. Looks like i fixed it. Following this tutorial: http://intelligentbee.com/blog/2013/08/07/symfony2-jobeet-day-1-starting-up-the-project/
just activate mod_rewrite with a2enmod rewrite and restart apache. that's it.
The company I'm working for has a PC for hosting our website. I can access the website with http without any problem but when I add https it gives me this error. We are using apache for our web server (XAMPP).
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
However when I try to copy the website to my other computer (also with XAMPP on it) and run the website in localhost with https its working fine. I tried to look for answer but I can't seem to find the one that I'm looking for. Does anyone have encountered this problem or know what may have caused this?
Thanks in advance
Had same issue on LAMP server. In the ssl.conf file we changed AllowOverride None for ; to AllowOverride All. That corrected the problem.
DocumentRoot /var/www/
< Directory />
Options FollowSymLinks
AllowOverride None
< /Directory>
< Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
< /Directory>
I fixed the problem. It was because the DocumentRoot directory and Servername in http-ssl.conf in apache/conf/extra folder was still set on default. I changed it so it uses the same servername and documentroot directory that I had specified in httpd-vhosts.conf
Originally I had mydomain.com.au, but then I let it expire as I cancelled my abn. After that I started using mydomain.info instead to host my WordPress site. Recently I had my abn re-instated so I have mydomain.com.au back again finally.
I decided to do a permanent redirect from mydomain.com.au to mydomain.info, and I put this in /etc/apache2/sites-available/mydomain.com.au.conf file:
<VirtualHost *:80>
ServerAdmin me#email.com
ServerName mydomain.com.au
RedirectPermanent / http://www.mydomain.info/
</VirtualHost>
It looks the same in /etc/apache2/sites-enabled/mydomain.com.au.conf also.
I reloaded apache2 without error and now I get this error when I try to access www.mydomain.com.au either locally or from an external IP:
Database Error
Error establishing a database connection
I decided to test whether the redirect was working by putting a dummy html file in /var/www/mydomain.com.au. I reloaded apache2 and tried mydomain.com.au again. Still getting the database error.
So now i'm thinking it's a problem with WordPress. Does WordPress not allow you to do this kind of thing?
The redirect was set up incorrectly. It was working for domain.com.au but not for www.domain.com.au. It needs to be:
<VirtualHost *:80>
ServerAdmin me#email.com
ServerName domain.com.au
ServerAlias www.domain.com.au
RedirectPermanent / http://www.domain.info/
</VirtualHost>
I need some help with this simple directory access rules - sorry I just started playing with Apache 2.4 and not done this before.
I have configured Apache 2.4 to a stage where I can see a login for for protected resources and once I enter the user/pass I get access to the protected resourced.
Now I want to do the following which I am not sure how I can get this done.
Web root is set to /var/www
/var/www/login - anyone can access, no auth required as this folder contains login.html and logout.html. ( I got this working)
/var/www - all other contents in the root of my app can only be accessed after authentication. This is the part I don't know how to setup.
My vhost conf looks like this.
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host2.example.com
DocumentRoot "/var/www"
ServerName auth-test.ml.com
ErrorLog "logs/test-error_log"
CustomLog "logs/test-access_log" common
<Directory "/var/www">
AuthFormProvider file
AuthType form
AuthName "Reserved Area"
Session On
SessionCookieName session path=/
require valid-user
# This is the login page
ErrorDocument 401 /login/index.html
# This is the file containing users login data
AuthUserFile /usr/local/apache2/auth/.htpasswd
</Directory>
<Directory /var/www/login>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
AT the moment when I access the app like http://example.com I expect to see the login.html page returned but I get the following error message:
Unauthorized
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
Additionally, a 401 Unauthorized error was encountered while trying to use an ErrorDocument to handle the request.
How can I make this work?
Figured it out. It was as simple as using Directory to first deny access to all to the root document and only allow valid users.
Using another Directory to open access to all to the auth folder.
This was working for years until I did something that has now jacked this up....
Searching on this topic landed me in several places that basically said: You need to check the Wordpress URL and the site URL in the general settings in Wordpress. I have done so and they are both: http://www.petesworkshop.com/blog_wp . Yet, when I hit that URL I am redirected to my internal IP and get a error http://10.0.10.206/blog_wp (yep, that would be wrong!
Interestingly enough, I can get to the admin page just fine and it is just a subfolder of blog_wp. So, somehow things directed to /blog_wp return the IP but everything else is OK. Wierd.
Wordpress sits behind an Apache proxy which has this directive for the virtual host:
<VirtualHost *:80>
ServerName www.petesworkshop.com
ServerAlias petesworkshop.com
ProxyPass / http://10.0.10.206:5080/
ProxyPassReverse / http://10.0.10.206:5080/
</VirtualHost>
The server running the website behind the proxy has this:
DocumentRoot "/www/petes/htdocs/petesworkshop/"
ServerName www.petesworkshop.com
ServerAlias petesworkshop.com
DirectoryIndex index.html index.php index.htm
ErrorLog logs/petesworkshop.log
Options FollowSymLinks
Alias /blog_wp /www/petes/htdocs/petesworkshop/blog_wp
<Directory /www/petes/htdocs/petesworkshop/blog_wp >
Order Allow,Deny
Allow From all
</Directory>
<Directory /www/petes/htdocs/petesworkshop >
Order Allow,Deny
Allow From all
</Directory>
I am not sure how I jacked this up...it is probably something that I did to the Apache configuration but I can't be sure since everything else behind the proxy works fine. I even tried adding specific ProxyPass entries for /blog_wp but that didn't make any difference.
Stumped...
Check your wp-config.php for correct urls
like below
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
This one turned out to be an Apache proxy issue. What I needed was to add 'ProxyPreserveHost On' to the configuration, which I thought I had in there originally but I either removed it in an edit or had it placed in the wrong virtual host. In any case, adding the ProxyPreserveHost On flag, took care of the issue. Not sure why other entries in the same virtual host DID work without it but I am not going to worry about it.
I had a similar problem some time ago, whenever I wrote my domain in the browser it was solved correctly but my domain name was changed by the IP, after much research it turned out that the problem was in the hosting, not in the server, so which only change the configuration of my domain in GoDaddy since I was only doing a redirection but the correct thing was to create an A record that points to # (which represents your domain name) and everything started to work correctly. I hope it's help