Wordpress site - home page opens but inner pages give 404 - php

This seems like very trivial, that its a .htaccess file issue, but it isn't.
I have a wordpress site, which was running at say demo.xxx.com I had to move it to xxx.com
so i just went to my apache and change the files to redirect the same to xxx.com and not to demo.xxx.com
i also went in wordpress and changed the url related settings from demo.xxx.com to xxx.com
the directory thus is the same for this source code.
the home page opens well, at first i thought may be i should reset all the permalinks, which i did but the inner pages refuse to open.
my .htaccess file is same as before, I don;t think there is anything wrong about it.

Have you tried to go to Settings -> Permalinks and choose a setting different from Default, then click the Save button?

When you directed Apache to go to your new site, was it in a different directory? If so, you probably don't have the same directory permissions. Permalinks use mod_rewrite and won't work unless Overrides are enabled.
Check and change your httpd.conf file...
<Directory "/var/www/xxx.dom">
AllowOverride None
</Directory>
to
<Directory "/var/www/xxx.dom">
AllowOverride All
</Directory>

Related

Errors after moving local Wordpress site outside of XAMPP\htdocs

Background
As someone who develops multiple websites I wanted to be able to serve each site from within its respective project folder in the filesystem, instead of serving them all under the htdocs directory.
So I moved my wordpress folder (whose site was usually accessed via localhost/wordpress) to my project directory, and followed the instructions in this answer to set up a virtual host with a DocumentRoot and Directory that matches the new location of the wordpress folder. This is the whole (uncommented portion) of my httpd-vhosts.conf:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "D:\Users\User\Documents\Projects\Websites\My New Project\wordpress"
ServerName localhost.irm
<Directory "D:\Users\User\Documents\Projects\Websites\My New Project\wordpress">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
The Problem
The homepage can now be found at localhost.irm, but it's text-only, with no styles or images, and clicking on any page takes me to an "Object not found!" XAMPP page.
What I've Tried
Accessed the database with PHPMyAdmin, changing siteurl and home in the wp_options table to reflect the new domain
Used the WP-CLI tool to search-and-replace all database instances of the old domain with the new one
Unfortunately none of these solved the problem.
This seemed to be primarily caused by two problems:
The Site Ground Optimiser plugin from my live site that I wasn't even aware was activated on my local site. Deactivating using wp plugin deactivate sg-cachepress (the WP-CLI tool) solved that.
The following line in my .htaccess file, at the root of my Wordpress site:
RewriteBase /wordpress/
I assume it must have been necessary to add for my previous setup and I'd since forgotten about it. Either way, removing/commenting the line out entirely seems to have solved the rest of the problem.
I'm now able to access my website with all styles and images, just like I was before, with the advantage that my files are now being served from my project folder itself instead of from XAMPP\htdocs.

Laravel Nova fails to render login page on the live server

I successfully installed Laravel and Laravel Nova in live server but when I tried to view Nova login page, I get index of/nova page and the page does not redirect any css.
Below is the screenshot of the page rendering:
In the config/nova.php the path is correctly set to:
config/nova.php
I need help to get this page to display correctly.
I found what the problem was. I got index of/nova because Laravel Nova login page was looking for the css folder, js folder, .htaccess, web.config from the root directory and it could not find then it displays index of/nova.
When I moved css folder, js folder, .htaccess, web.config to the root directory, then voila I get the login exactly as I wanted.
Below is the correct display of laravel login page:
Thanks everyone who tried their best to help.
In your case the problem might not be with the web application but with the settings of the webserver.
I use Apache and this is what my 'virtual hosts' (httpd-vhosts.conf) configuration looks like for one web application:
<VirtualHost *:80>
ServerName laraveltest1
DocumentRoot "c:/users/jorisj1/source/repos/laraveltest1/public"
<Directory "c:/users/jorisj1/source/repos/laraveltest1/public">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
In your case the DocumentRoot might point to the actual root of the application. Try changing it to the public directory.

Cannot navigate to CodeIgniter site

I have a Ubuntu server with 2 websites on it. I can navigate to one, but not to the other. Here are the details:
Each website has a user with the same name as the group and as the subfolder. Sites are hosted under
/home/site1/public_html and
/home/site2/public_html
Now in my case site1 is called from a subdomain, but it works just fine, so if I navigate to site1.mydomain.com it opens up the CodeIgniter page and I can navigate with no issues (I have .htaccess here to get rid of index.php in the url).
However when I try to navigate to www.site2.com which points to /home/site2/public_html it gives me a 404 error. So to troubleshoot, I added a /home/site2/public_html/index.html simple file and I can see that if I navigate to www.site2.com, however I can't see it if I navigate to www.site2.com/index.html. Also, in my case, I have a subfolder (with same name as the site = "site2") where CodeIgniter code/folder structure is and I just can't get tot that index.php from code igniter at all (path to it is /home/site2/public_html/site2/index.php). I tried to navigate as www.site2.com/site2/index.php or www.site2.com/index.php with or without htaccess file but with no help. I tried to remove the .htaccess in this site, I tried to create a test.html in /home/site2/public_html/site2 but I can't navigate to it, I get 404 if I do www.site2.com/site2/test.html
in terms of user access I used $ chmod -R 755 /home/site2
Is it an access right that I am missing? Or a conflict with the other .htaccess from the other virtual folder? No clue... and I am just running out of ideas
V Host Settings
ServerName site1.mydomain.com
ServerAlias site1.mydomain.com
DocumentRoot "/home/site1/public_html"
<Directory "/home/site1/public_html">
AllowOverride All
allow from all
Options Indexes FollowSymLinks MultiViews
Require all granted
</Directory>
and for the one I've trouble with
ServerName www.site2.com
ServerAlias www.site2.com
DocumentRoot "/home/site2/public_html"
<Directory "/home/site2/public_html">
AllowOverride All
allow from all
Options Indexes FollowSymLinks MultiViews
Require all granted
</Directory>
NOTE : I just made a subdomain site2.mydomain.com (domain registered with FatCow) and that seems to be working, it does not work only when I call it with www.site2.com (register under GoDaddy - which gives a GoDaddy "Destination unknown" page which I assumed it is a 404 error and always asks me to Accept cookies ... and I am on a diet :P )
Thanks anyone in advance!
oh darn thing, you were right #sintakonte, one site was pointing somewhere else. Go daddy had a A record with old IP address, I added another A record and asked them to park the original (as I had no rights to do so from their website). And problem got resolved. Thank you!

Wordpress alongside Symfony - Error 404 page not found

We have a wordpress blog hosted in a different from our web application. For SEO concerns, we decided to rebuild the blog on the same server as our application.
It already has a Apache2 running with the root path directing to our Symfony application /web folder.
We installed Wordpress in var/www/wordpress, set the permissions on this folder for Apache2 and configured the DB connection. The homepage of our wordpress is visible on the /content path (www.mysite.com/content).
For that, I added a single to my existing apache2 conf :
Alias /content /var/www/wordpress
We started building the homepage, uploaded themes, everything works fine. But when we want to add a new page (ie. /content/blog), we get a 404. Resetting the permalinks does nothing. Setting the permalink mode to ?pageId=XXX allows us to see the new page, but that's not what we want.
Did I miss something in my apache configuration ? Any idea ?
Thanks
In case anyone stumble upon this looking for an answer, I had to add some configuration to Apache for my site :
<Directory /var/www/wordpress>
AllowOverride All
Order Allow,Deny
Allow from All
</Directory>
<Directory /var/www/wordpress>
Options FollowSymlinks
</Directory>

Magento index.php required with SSL for login and checkout pages [HTTP 404]

I am using magento 1.9, I've got installed SSL which is working just fine.
The problem is when I am switching my secure link to https:// - all pages are working correctly, but pages such as checkout, register and login are throwing error 404, unless I manually add prefix with index.php
These links are working correctly when I am working with non-secure connections.
For example this links are working correctly:
http://myshop.com/customer/account/login/
http://myshop.com/customer/account/create/
But my links
https://myshop.com/customer/account/login/
https://myshop.com/customer/account/create/
are throwing HTTP 404 - Not Found - In order to make it work I have to manually add index.php prefix so my links look like this:
http://myshop.com/index.php/customer/account/login/
http://myshop.com/index.php/customer/account/create/
I have changed my .htaccess file, and I think the problem lies in this file. How can I edit this file so it fits my purposes ?
Any other solutions are more then welcome also.
The SSL has its own configuration files and sometimes when SSL does not work well, it may give the error of 404 (Page not found). Normally, the file name is http.conf or ssl.conf or default-ssl file which depends on your OS
Find here:
<Directory "path to your directory">
SSLOptions +StdEnvVars
AllowOverride All
</Directory>
make sure that AllowOverride All is present in your config
if it does not help attach what OS and web server you are using
Double check if you have enabled Web Server Rewrites
config > general > web > Search Engine Optimization > Use Web Server Rewrites > Yes
P.S restore the .htaccess file before try above method
Checked some of your website current pages such as https://www.myshop.com/registreren and it is working fine with https.

Categories