0

I have built a site for a client using WordPress. The site was built on the subdomain http://staging.url.com. Using Plesk I restricted access to the 'staging site' using a password

When site was completed I downloaded 'staging site', duplicated the database and re-uploaded to http://www.url.com. Everything works ok apart from when I'm logged into the wordpress admin, I get the Authentication Required pop-up, saying http://staging.url.com requires a username and password.

I cannot find any file that would be telling the server that http://www.url.com is http://staging.url.com and prompting the Authentication Required pop-up.

Can anyone help?

Many thanks,

Elliott.

Current http://staging.url.com 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

AuthType Basic
AuthName "restricted area"
AuthUserFile /var/www/your-url/.htpasswd
require valid-user

Current http://www.url.com 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
Elliott James
  • 165
  • 14

1 Answers1

2

I think your files it is loading from your staging website
Go to inspector on your browser and check if any image or files are loading from your staging in the production website.

rafahell
  • 317
  • 1
  • 7
  • '# BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress' 'AuthType Basic AuthName "restricted area" AuthUserFile /var/www/html/your-url.com/.htpasswd require valid-user' – Elliott James May 25 '16 at 09:43
  • yes, remove it: AuthType Basic AuthName "restricted area" AuthUserFile /var/www/html/your-url.com/.htpasswd require valid-user – – rafahell May 25 '16 at 09:44
  • Ok, they only exist in the /staging.url.com directory. Do you know why they would effect the /url.com directory as well? There is none of that code in the file. Thanks. – Elliott James May 25 '16 at 09:48
  • could you check in the control panel? maybe your host is doing that on the control panel of the host – rafahell May 25 '16 at 09:50
  • They were, but I deleted the protection when I started getting this issue. Before I added the .htaccess protection I was protecting it using the control panel. I added the manual settings in the attempt to resolve the issue. But it's doing it. Interestingly, if I disable the password protection on the staging site, it no longer effects the 'live' site. As soon as it goes back on though, it effects it again. – Elliott James May 25 '16 at 10:01
  • as I said above... images are coming from your staging website. You should change in the production website all the paths. could you provide the link? and let me know if works – rafahell May 25 '16 at 10:05
  • 1
    I can't provide the link, but you're right. Both the production site and the staging site are sourcing files from each other. I suspect this is my issue! Perhaps you can add that as an answer so I can mark it as correct? – Elliott James May 25 '16 at 10:11