TLDR:
Recently migrated my site to a new host. The header and footer (without CSS) show up, but the pages all show "Page Not Found".
Further Explanation:
I migrated my site (small CakePHP project) to a new host, and did these steps:
And follow this steps:
Migrated every file and folder
Imported the complete database
Changed the database configuration
Checked the folders, everything is set to dirname, and stuff like that, so no problem
Now, when I access the site in the new hosting, it shows page not found, and the CSS are missing. I edited the index.php on app/webroot and added a few echos to see if the flow was ok. If I add an echo, the CSS works (if I add echos in any part of the source, the echo was echo '1';) but still with the "Page Not Found".
What version of CakePHP are you using? If it is 2.x, you need to make sure you have php 5.2.8 or greater.
The other thing to confirm is that mod_rewrite is enabled and working correctly. It sounds like this may be the issue.
Maybe you forgot to copy any of the .htaccess files.
Related
I have this weird problem with my Wordpress Website. I worked on localhost and afterwards I tied to get my site online but i modified some configuration files and i don't know witch one is the fault. I am using XAMPP. The website right now is seems to not load js and css. Also on console log it gives 404 error for not fiinding the files it needs.
Landing page:enter image description here
Another Page:enter image description here
do you use gzip compression or such as it? if yes try to disable it, and make sure you have the right path
First, check that the file permissions are correct.
Also, if you have changed anything on your .htaccess files, overwrite them with the default ones: https://github.com/WordPress/WordPress
Also it's always a good idea to go to the permalinks page (/wp-admin/options-permalink.php) to update the links of all dependencies to the new URL.
I've got a legacy PHP project to fix a thing or two. I've downloaded it via FileZilla and served it on my local machine with a local copy of the database. The project is exactly the same with the live one, yet the live one can open the url/contact.html but on my machine it says no such file is found. All other pages go for url/categories/ or url/products/ so I've tried altering the url but no use.
All the other pages within the site are simple: one .php controller one .php model and one .tpl smarty template view. Requiring no .html at all. But this one is somehow different. The .htaccess file is exactly the same as the live version. I've tried adding a rewrite rule to direct every .html to .php but didn't work. I'm lost and out of options, please help? It doesn't even have to be an answer,"Try looking into that" would work too.
I'm working via XAMPP on windows, and I've configured the https:// to http:// on my project but that's all. Even hidden files are checked and confirmed.
have checked that contact.html is a static file (like a real existing html file?)
is there some kind of "routing" within the PHP of the project? If there is route urls might be really anyware.. in the mysql database, redis, a json file and whatnot.. have seen them all.
try to debug where and how it works on the "production" server by using some logging to a file edit the file through filezilla and log to a 'mylog.log' file until you find out what is going on.. or if the site is not used all the time by clients - you can just try to echo stuff to figure out how this exact /contact.html works
I've migrated many Wordpress sites before, but now I'm having an issue I just can't seem to solve. Some, but not all of the links are not loading properly.
I'm migrating from local.dev to example.com/test.
In my database options, I have both options set to example.com/test.
I doubled checked the options in the WP backend, and they're example.com/test.
I've updated my permalinks.
All of the pages work, all of the links work, but a few references to images, etc do not - they're loading example.com/ instead of example.com/test.
I think it might have to do with the .htaccess file, because I can't update it from the FTP side. If I delete it and update permalinks, no .htaccess file is created. I don't have access to any server side overrides, only the files.
In my MAMP vhosts, I have SymLinks Override set to All, but I can't edit anything like that on the live host.
The links that aren't working are along the lines of $image = get_post_meta(37 ,'_my_meta',TRUE)['img']; which should return
http://www.example.com/test/wp-content/uploads/image.jpg
but instead returns
http://www.example.com/wp-content/uploads/image.jpg.
Using bloginfo('wpurl'); returns http://www.example.com/test, and all similar ones return properly (site_url();, 'template_directory', etc.
In the end, the site is going to go on http://www.example.com without the subdirectory anyway, but I'm sure I have to get it to work properly to prevent future errors.
I also updated to the newest version of Wordpress at some point, not sure if that could cause any issues.
I believe the issue deals with media and links placed in content items.
I use to do some manual SQL queries to fix this but now I run this plug-in https://wordpress.org/plugins/automatic-domain-changer/
The plug-in will go through all the content and make the needed changes.
The links that aren't working are along the lines of $image => get_post_meta(37 ,'_my_meta',TRUE)['img']; which should return
http://www.example.com/test/wp-content/uploads/image.jpg
this meta information is stored in the DB. then to make the migration you have to change all the old URL in the DB before to import it in the new place
A friend of mine asked me for a favour, to move his website. The programmer who made it, send me an archive with the database, and the rest of the files needed. I've installed it on my localhost, with apache, php and mysql installed on it.
I have a problem with it. If I go to localhost/mgro/index2.php, it shows somehow a minimal version of the website, but if I click on something, it gets to index.php?something_else_here and it works. If I go to localhost/mgro I just see the files, and if I go to localhost/mgro/index.php it redirects me to localhost/mgro.
About the configuration file, I've used the configuration.php-dist file, with new info in it. What I've changed was just the database, user and password for the database.
Basically, everything works fine, except that index.php with no requests, because it "backs" me into the folder
NEW PROBLEM: If I click on an Add to cart button, it redirects me to the website that is online.
Is this Joomla 1.5 or Joomla 2.5.x / 3.0? I'm going to guess that you have a potential issue with the live_site variable in the configuration.php file, especially if you're using Joomla 1.5. Make sure that it is configured to your localhost's live site URL directory.
Some other things to check:
1) If you're using SEF urls you need to use a .htaccess file. Usually the one Joomla' includes by default works (if you don't have it you can redownload it from Joomla's code repos: http://joomlacode.org/gf/project/joomla/frs/?action=index
2) When logged in go to global configuration and check the option "URL rewriting". You can try switching it off. (On does require the .htaccess file mentioned before).
3) If you're just seeing files when you hit the directory then Apache isn't configured to load .php files. Since you're running a localhost you'll have to track that down somehow.
Some other notes:
-Index2.php isn't anything, don't use it.
I have a WordPress website that's been running for almost two years now. All of a sudden, it started to show a blank page on any public page. The admin part on /wp-admin is still working without any problems.
A http request is successful (status 200), but the returned content is completely empty (not even an tag).
I'm not really a PHP/WP expert. A simple web search got a lot of results, but mostly old stuff and never any clear conclusion of the problem's source, i.e. how to fix it. I already enabled WP_DEBUG in wp-config.php, but this only shows debug messages in wp-admin, but the public page remains blank.
Where should I continue searching?
The problematic website is http://lolkitten.org/.
Update
I just found index.php inside my public_html, which was empty. After writing something into it, it appears on my home page! Also, there's a directory /home/<user>/home/<user>/public_html/ which looks like complete nonsense to me.
Update 2
The Problem solved itself after upgrading to Wordpress 3.8. I don't know why, but it seems like some files (like index.php) were messed up and got replaced by fresh ones in this update.
Possible solution / workaround
I've had this problem again. This time, my index.php was completely empty. In my dashboard, under Dashboard > Updates, I clicked on Re-install Now and it fixed itself.
Most likely the wp-content folder can’t be found. When you login to the admin does it state that the templates can’t be found in red text in the center of the page right when you login?
I recommend going into your wp-config.php and adjust—or add—the following constants:
define('WP_SITEURL', 'http://lolkitten.org');
define('WP_HOME', 'http://lolkitten.org');
define('WP_CONTENT_DIR', '/path/to/your/wp-content');
define('WP_CONTENT_URL', 'http://lolkitten.org/wp-content');
Fairly confident that the key to fixing this will be the WP_CONTENT_DIR setting. You need the full path to the directory in the file system to your wp-content folder. So if you have a standard Unix setup with lolkitten.org in it’s own directory that path would be:
/var/www/lolkitten.org/wp-content
And the WP_CONTENT_DIR value would be:
define('WP_CONTENT_DIR', '/var/www/lolkitten.org/wp-content');
EDIT Adding info on how to determine your script’s absolute path if you do not have SSH access to the server, but have FTP access of some sort. Just FTP to the server & create a test file called test.php and just put the following code in it:
<?php
echo dirname(__FILE__);
?>
Now load that into your browser to get the full path:
http://lolkitten.org/test.php
__FILE__ is a magic constant in PHP that will echo the full/absolute path of a PHP script.
try deactivatinhg all the plugin once.
And if you can not access admin panel do the following to deactivate plugins
In the database - wp_options table
change the entry to a:0:{} on option ID 35- active_plugins
As far as i see error, it is because of share-buttons plugin.
Try removing share-buttons plugin from plugin folder and then check again.
If still problem exists then remove all active plugins and check again.
I too had same issue and it was because of plugin. I deactivated plugins one by one and my site was recovered from crash.