WordPress: Non-existent pages are being loaded - wordpress

I believe a hacker modified the website 'http://bbltechnical.co.uk/' so that loads of dating website show up in Google search results for the website. I have looked for those posts/pages via the dashboard and database, and the don't seem to be anywhere.
(I warn further click-through links on the following page contain explicit content)
Example spam page: http://bbltechnical.co.uk/online-uk-dating/
You can see I have changed the theme of the actual website, yet the theme hasn't changed on the spam pages. Using Wappalyzer I have found the WordPress versions differ. Also the two images in the body text of that page do not exist on the FTP. So I have concluded it is another WordPress set up, sharing the same domain name.
I have cleared the database, flushed out the DNS records, and even spoken to GoDaddy about it. It is such a weird behaviour.
This is the .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

I found it was a modification of 'wp-blog-header.php', at the root of the site, which edited the HTTP header to pull in data from another website.
I used a malware scanner plugin to scan for any changes to the core WordPress files.
Thanks to uvishere's suggestion, I used the plugin 'Sucuri Security' to scan for the changes. Another option is the plugin 'Wordfence'.

Related

Only default permalinks working WordPress, others permalinks options becomes 404 error

My problem is in my WordPress site only default permalinks are working. When I change permalinks all pages become not found (404). The home page and the shop page is the only working with post name.
Before this problem, I have one more question. that was my site was hacked or may be due to plugin it has some unnecessary files which redirect to some dating site. But I have checked them and delete using WordFence Wordpress plugin. The site is clean now!
This is my .htaccess file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
What I did so far?
Change permalinks type and save twist. (nothing work even in a private window)
Change rewrite mode in the database file (clear that field empty and change permalink type. not work)
*Which plugin I have used?
Really Simple SSL
Wordfence Security (pro)
Other plugin related to the theme such as slider revolution, WooCommerce, Contact Form 7 etc. I think they are not that critical to this problem.
I have checked these posts:
only default permalinks working wordpress others become 404 error
After changing domain name of wordpress site only default permalinks working wordpress others returns 404 error
Non of answer work for me. That why I'm post this as a new question here. Also i have post this to https://wordpress.stackexchange.com/ couldn't find an answer yet.
Thank you

Wordpress serving every page and files as homepage

I have a wordpress install that is a multisite setup and the site has a DNS pointing to it.
Both the site and home URLs have been changed to the domain.
If i visit the site all the javascript and css files are served as the homepage HTML so everything is broken. Also if you click on any link it delivers the homepage and not the requested page.
I have tried changing the theme to twenty seventeen and disabling all the plugins, but the problem persist.
Any help or direction would be greatly appreciated.
Update:
I moved the site to a subdirectory and changed back to a single site, so now the site is almost a direct clone from its original host, but the problem with every page loading the homepage still persists.
here is the htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subdirectory/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /subdirectory/index.php [L]
</IfModule>
# END WordPress
Update 2:
Digging deeper i found that every page has empty query vars which is why its only loading the home page.
add_filter('request', 'overwrite_query', 10, 1);
function overwrite_query($q){
var_dump($query);
}
returns
array(0) {}
Have you tried deleting the htaccess file and trying a new one? I think WP will create one if it doesn't find one.
Please open wp-admin page (Wordpress back-end page) then update permalink. then after work perfectly javascript and css.

Wordpress .htaccess/template files

I have a Wordpress site that I assumed from another company which structurally is a bit different than other ones I've worked on. I'm primarily a Drupal developer, with enough of a working knowledge of Wordpress to get by.
What the developer who created the site did, is within the themes folder, they created a separate page-whatever-whatever.php file for each page on the site. Some of the content on the pages within the site have been entered through the CMS system - some are hard coded on to the template file.
Previously, it was hosted on a .NET server - we're on LAMP.
It appears that the pages with the hard coded data aren't being called - so the data the client previously saw is just coming up blank. The site appears to be ignoring those page-whatever-whatever.php files and using the default template page instead.
My first guess is that it's an htaccess issue? I just have the generic
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Given the structure they have - is there something else I should be putting in there or changing within the config files?
Thanks in advance!
I guess no issue with .htaccess file. The error was in template file. Enable debug in wp-config.php.
By wp_debug was false.
define('WP_DEBUG', false);
Change this to
define('WP_DEBUG', true);
Now you can see php error in the template file then debug it.

htaccess redirects to blank page

Recently my wordpress website was hacked, and mobiles were redirected to an unsavoury site. I didn't have any previous knowledge of .htaccess, but I'd read that the culprit would be there. And it was, so I deleted everything in the .htaccess file. But it stopped working entirely, so I found this generic wordpress redirect code. The code is
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>
# END WordPress
It works fine now when viewed from a desktop machine, but whenever it is viewed from a mobile device it redirects to a blank page.
Any ideas?
It sounds like there was probably a specific mobile redirect rule in your old .htaccess file, which has now been erased and/or there is some specific WordPress code that handels the redirect.
Ideally, you would restore your files from a backup. But if you don't have a backup, you'll have to do some sleuthing.
I am not particularly familiar with WordPress, but I suspect you probably installed a WordPress plugin in order to get the mobile-specific functionality or redirect. If that's the case, you should either reinstall it or reach out to the maintainers of that plug in.
Otherwise, you can find a variety of different Apache redirect snippets for redirecting mobile devices - some Googling would probably help you find what you need.

Cant create new pages - wordpress. Possible Mod-rewrite error?

I've changed my permalink structure to be /%year%/%monthnum%/%day%/%postname%/ through wordpress, however, when I go to create a page it does not seem to work.
My .htaccess looks like:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Do I need to add a new "ifModule" in there for pages? If so, please provide one.
Thanks,
Your .htaccess file and permalink structure won't affect your ability to create new pages, only view existing ones. When you create a new page WordPress uses admin URLs such as /wp-admin/post-new.php?post_type=page to show the form and publish changes.
If you try to save a new page, but it isn't listed in the admin console, then new records aren't being created in your database for some reason. It may be that your server has run out of disk space or your account is over disk quota.
If new pages are being saved, but all pages aren't viewable on your website, then it probably is a permalink problem. The default WordPress .htaccess has always worked for me, and the latest 3.2.1 version generates the same rules you've posted. If you're running on a linux web server that should be okay for both posts and pages.
As a last resort you can switch to the default permalink structures such as /index.php/%year%/%monthnum%/%day%/%postname%/ which doesn't require redirects.
Hope that helps

Resources