As a process of white labeling WordPress websites for my clients I was wondering if I can mask admin panel URLs from these:
https://www.somerandomaddress.com/wp-admin/index.php
https://www.somerandomaddress.com/wp-admin/post.php?post=12&action=edit
to these:
https://www.somerandomaddress.com/admin/index.php
https://www.somerandomaddress.com/admin/post.php?post=12&action=edit
Preferably I don't want to change core WordPress code so official WordPress updates can be applied without any problem.
You need to modify your .htaccess in order to wp work as before and see the url only changed.
Try this:
RewriteRule ^wp-admin/(.*)$ /admin/$1 [QSA,L]
For that you can use the plugin
Protect Your Admin
This problem started yesterday.
When the public visitor view my website, the Wordpress navigation bar will appear on top of the page as if they are a login user. They can even see the greeting message on top right corner, "Howdy, John(My name)"
The good news is, these public visitors will not be able to access the wordpress configuration page. They can only thee the top navigation bar when they view the page.
My question is, what is going on?
Could it be a plugin?
Could it be CDN (Cloudflare) problem?
Could it be the hosting site problem?
or could it be a hacker's deed?
Please help, I have no idea where to begin with.
You're probably serving fully cached pages (which includes the logged-in user content) for all visitors. This means that a new visitor will get served the exact same HTML and other assets that have been served earlier for a logged-in user.
I would start by checking the Cloudflare settings and see whether there are any options for disabling the cache for certain types of visitors (e.g. validated by cookies).
Problem solved.
Apparently, the culprit is the wrong configuration in Apache Server.
One of our engineer added the snippet below into the .htaccess as a recommendation from LiteSpeed module for Wordpress. This little devil makes Apache server to do full-page caching.
<IfModule LiteSpeed>
CacheEnable public /
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(HEAD|GET)$
RewriteCond %{REQUEST_URI} !^/(wp-admin|wp-login.php|wp-cron.php)
RewriteRule .* - [E=Cache-Control:max-age=120]
</IfModule>
Thank you #ojrask for pointing out the possibility of full-page caching in Apache Server.
Recently at our agency we needed to do a serious overhaul of our servers, so I've had to migrate the sites onto a local host machine so that I could work on them in the meantime. I used WAMPserver to host the sites, and the sites are powered by Wordpress. When the move was complete, I checked the sites on my local host to see how they looked. The front pages looked perfectly fine, but whenever I tried to navigate to the inner pages, I was met with nothing but 404s. My supervisor believes it might be connection issue, but I wanted to check here first to see if anyone else had similar problems.
OS: Windows 7
WAMPserver version: 2.2
Steps already taken
I made sure that the local databases were named exactly as they were on the original server, and I double-checked with the wp-config file.
I made sure to obtain the SQL files for the databases and imported
them in phpmyadmin.
I went into the SQL files and changed all of the links (changed all instances of http://www.sitename.com to http://localhost/sitename)
I logged into the Wordpress admin dashboard to check if all of the content was actually there. Everything was intact, but even clicking on "view post/page" on each individual post/page resulted in a 404.
I tried returning the permalink options to default and then changing them back, but that didn't work.
Unfortunately, I cannot provide any more information as I am no longer in the office. I hope that I can receive some help by the time I go back in tomorrow morning.
It sounds like an issue with mod_rewrite. Try adding AllowOverride All to your virtual host.
If that doesn't work then also check your httpd.conf for the following line
LoadModule rewrite_module modules/mod_rewrite.so
Make sure it's not commented out.
In my case I migrated from example.com to localhost/example when this error started showing up. mod_rewrite was on. What I had to do was edit .htaccess and change the last line in the block <IfModule mod_rewrite.c> (line 8 for me) from this
RewriteRule . /index.php [L]
to this
RewriteRule . /example/index.php [L]
Here's my situation.
I have followed the exact instructions on wordpress codex page about moving a site to another server.
Here are the step's i have taken.
Export a copy of my database
Make a new database in the new server
Import the database I exported earlier
Upload a copy of my Wordpress files via Ftp
Use this script to change all my local url's to new one's
Make changes to my wp-config.php file according to the new server(I did not forget table prefix. Although it has some uppercase characters in it )
And then when I try to open my site on the new location it just directs me to wp-admin/install.php
Now just to make the scenario clearer: The destination folder(on live server) is a sub directori in a public_html folder which already has another wordpress install inside it(I'm saying this just in case it should matter)
My .htaccess looks like this
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subDirectoryName/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /subDirectoryName/index.php [L]
</IfModule>
# END WordPress
I have tried checking and repairing my tables via phpMyadmin but everything seems to be ok there and has no effect on the problem.
I also tried emptying the database on the live server and go through with the install. And it installs with no problems and everything works fine but, well I have no use for another clean install. But I think this at least rules out any trouble with wp-config file.
I'm using Wordpress Version 3.3.1
So I guess the big question I'm left with is:
Why isn't wordpress recognizing my Install after migration?
Any help much appreciated!
Well finally I have solved the problem. And surprise, surprise It was the freaking UPPERCASE letter in my table prefix. I had it this way in my wp-config file wp_C5n but for some reason most of the tables got a prefix wp_c5n. But not all. So what id did was I changed my table prefix in wp_config file to all lowercase and then went through all the tables by hand via phpMyadmin to see If there's any uppercase tables left. There where about 3. They were inside usermeta table and inside options table. Now finally everything is working.
Did a quick search through wordpress codex but did not find anything mentioning not to use uppercase characters.
Resolved: wp-config.php setting
I had a similar problem. I got the install.php after moving files and creating a new database. It seems the install screen shows up it there is problem finding the correct database tables.
I fixed the problem by changing the following settings to be correct:
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'HikeforLife_dev11');
/** MySQL database username */
define('DB_USER', 'HikeforLife_dev11');
$table_prefix = 'wphk_';
I experienced the same issue as the OP - Wordpress keeps redirecting to install-php after migration.
Problem was my database tables are named as prefix_tablename and I missed the underscore from $table_prefix in wp-config.
$table_prefix = 'myprefix';
should have been
$table_prefix = 'myprefix_';
I would check two things:
First, I would check the url that is configured in the database. Check the wp_options table and the values of the "siteurl" and "home" options, it is possible that you need to update them if your domain has changed.
Another option is that your Apache server could not get the .htaccess. Check if the "AllowOverride" option is "all" in the httpd.conf file.
I hope it helps.
I experienced a similar issue. None of the suggestions above helped me, though.
Eventually I realized that the Wordpress MySQL-user on my production environment had not been assigned sufficient privileges.
As I was trying to install server setup to localhost, I have configured the config file as well as DB in local host- I was redirected to the install.php.
wp
Check:1
Go to yourTableName_options
Move to 'option_id'- '1' Change 'yousite url' to 'localhost/youLocalSiteFolderName'
Move to 'option_id' - '37' Change homw value to 'localhost/youLocalSiteFolderName'
Check:2
Move to 'wp_config' file check : $table_prefix = 'yourNew_Prefix_';
Hope it will help
Don't forget also the table prefixes if you installation don't use the default prefix.
This happened to me after I copy migrated an existing website to WP Engine and forgot to do one thing required by WP Engine:
Update the WordPress core installation of the site that is being copied to the latest version.
So here was the problem then:
My old site that I was copying from another server to WP Engine had version 4.0. However, when you copy an existing site to WP Engine, you don't copy the WordPress core files, you only copy the contents of wp-content and the state (or snapshot) of the existing database. So the state of the database for my existing site was for an installation running WP 4.0. Nevertheless, when you create a new WordPress install on WP Engine, that install is created with the latest version of WordPress, which, at the time happened to be version 4.0.1, so that means the core files on the destination (WP Engine) were for a 4.0.1 installation but the database snapshot I was gonna import into WP Engine was for version 4.0. So when I overwrote the default WP Engine database with the import of the copy the database of my old site, I got the redirection error to the install script.
So to fix it, I just logged into the WordPress admin site of the site on WP Engine, made sure to reset the file permissions (by clicking the blue button), which, you sometimes have to do on WP Engine, and then re-installed the WordPress core, which, basically updates your database so that internally the db state was for a WordPress 4.0.1 install and the core files also match the version.
Took me a while to figure out what was going on.
I had the same problem and I fixed it by changing the database user privileges to full read & write.
I experienced this issue today and started searching on internet. In my case there was no table in my DB. I forgot to import the tables on the online server. I did it and all works fine.
It seems that in general, this happens when Wordpress doesn't find the site information in the expected places (tables) in the database. It thinks no site has been created yet, so it starts going through the installation process.
This situation means that:
Wordpress WAS ABLE to connect to a database. If it didn't, it would say there was an error and refuse to install or do anything else
AND
it didn't find the things it was looking for in the expected places in the database it connected to.
Just to be clear, both 1) and 2) are happening when you see this symptom.
Possible causes:
Wrong database. You're working on several projects and you copied and pasted wrong database name, database host, or table prefix to the wp-config file. So now, you're unwittingly destroying ANOTHER client's website while agonizing over why isn't THIS website working at all.
Wrong database prefix. You can put several Wordpress sites in one database by using different prefixes for each. Make sure the tables in the database have the same prefixes as you entered in your wp-config. So, if wp-config says:
$table_prefix = 'wp_';
Check that the tables in your database are called "wp_options", etc. and not "WP_options", "mysite_options" or something like that.
The data in the database is corrupted. Maybe you messed up while importing the sql dump, you imported a truncated file, a file belonging to some other project, or whatever.
I tried all of these solutions before I realized that I had enabled opcache in PHP on my live environment. Wordpress was not reading a cached version of wp-config.
I got this problem when I used br tag in single product page of woocommerce.
I was trying to edit the template that suddenly everything ... .
that was a nightmare.
My customer could kill me. try not to use this br tag anywhere.
There can be many causes to this problem.
My suggestion is to turn on WP_DEBUG in wp-config.php
define('WP_DEBUG', true);
This happens due to the following issues:
Missing Files
Database Connection Details Problem
Site URL Issue
.htaccess File Issue
Webserver Failure
Resources Blocked by Plugin
Query Limit Exceeded
Insufficient Database Privileges
PHP Extensions
Reference: https://www.scratchcode.io/wordpress-keeps-redirecting-to-wp-admin-install-php/
In my case I had made a post on my website and added the post link to a button. Later I updated the post's title and link but kept the old link for the button which led to this error.
To solve this: I went to the database from my dashboard, found a table named wp_posts and deleted recent entries of my posts.
fellows!
In my case the problem was different. I had just to fix two things in wpconfig.php.
The $table_prefix = 'wpxx_' and the DB_HOST', 'mysql.hostinger.com' were wrong.
Hope it can help some people!
In my case after restoring the database and wp-content folder, my home pag was redirected to wp-admin/install.php. If I login from that page it was fine but as soon as I log out, my home page was redirected to wp-admin/install.php
I deleted the caches:
Nginx: rm -rf /var/www/cache/*
Plugin: rm -rf /var/www/html/wp-content/cache/*
Purged the cache on cloudflare for the domain
And the error was gone.
This might be easy to accomplish but I stuck ...
I had this Zend application installed on http://www.example.com
using Zend_Auth to identify if user can see the rest of the page.
So I have code like
if (!Zend_Auth::getInstance()->hasIdentity()) {
$this->_helper->redirector('login', 'login');
}
Now I Install WordPress under http://www.example.com/blog/
And using .htaccess to allow access to the blog as below and the same time, zend application can work
RewriteRule ^blog - [NC,L]
RewriteRule ^.*$ public/index [NC,L]
However, I don't want anyone to see the blog, only people who login to zend be able to see it.
I am guessing the logic should be
1. put this blog under Zend directory somewhere as external application
2. Use Zend Controller to allow access to this page?
But how can I implement this ? Any help is appreciated.
The best way of doing this is by creating a Wordpress Module,
The simples way of doing this is by modifying pulic/blog/index.php
Include zend session and the code to check the auth.
If auth does not exist or is invalid redirect to login.
For the rewrite you might want to redirect anything that starts with blog in the url to the wordpress index to be compatible with fancy url's.