Wordpress query - duplicating site/redirect

Associate
Joined
23 Jun 2007
Posts
552
Location
South East
Hello!

I have been asked to duplicate a wordpress site for a friend in order to test a new theme and content.

I duplicated the content under their main domain in a folder called '2' and created a duplicate database then pointed it at the new location.

The issue is when navigating to sitename.com/2/ it redirects to one of the articles - I don't know whats causing this and they have a number of different plugins doing many things(!)

Is there an easy way to diagnose what is causing the redirect?

Thanks in advance

:)
 
if you look in the wp-config file there is probably a hard coded reference to the url. change that and it should work...
 
if you look in the wp-config file there is probably a hard coded reference to the url. change that and it should work...

I have changed all references from old to new in the database and wp-config but the site still redirects to an article.

It always goes to the article starting with "2011.." so it must be directing domainname.com/2/ to that somewhere.
 
permalinks settings then? that can be the only thing left...

Permalinks are set to custom structure and are in this format "/%postname%/%post_id%/"

And the contents of the htaccess file.. I believe all the code at the end was added due to a thumbnail plugin exploit.

Code:
# 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

RewriteCond %{REQUEST_URI} .*((php|my)?shell|remview.*|phpremoteview.*|sshphp.*|pcom|nstview.*|c99|r57|webadmin.*|phpget.*|phpwriter.*|fileditor.*|locus7.*|storm7.*)\.(p?s?x?htm?l?|txt|aspx?|cfml?|cgi|pl|php[3-9]{0,1}|jsp?|sql|xml) [NC,OR]
RewriteCond %{REQUEST_METHOD} (GET|POST) [NC]
RewriteCond %{QUERY_STRING} ^(.*)=/home/loginftp/(.*)$ [OR]
RewriteCond %{QUERY_STRING} ^work_dir=.*$ [OR]
RewriteCond %{QUERY_STRING} ^command=.*&output.*$ [OR]
RewriteCond %{QUERY_STRING} ^nts_[a-z0-9_]{0,10}=.*$ [OR]
RewriteCond %{QUERY_STRING} ^(.*)cmd=.*$ [OR] ## ATTENTION A CETTE REGLE. ELLE PEUT CASSER VOTRE SITE ##
RewriteCond %{QUERY_STRING} ^c=(t|setup|codes)$ [OR]
RewriteCond %{QUERY_STRING} ^act=((about|cmd|selfremove|chbd|trojan|backc|massbrowsersploit|exploits|grablogins|upload.*)|((chmod|f)&f=.*))$ [OR]
RewriteCond %{QUERY_STRING} ^act=(ls|search|fsbuff|encoder|tools|processes|ftpquickbrute|security|sql|eval|update|feedback|cmd|gofile|mkfile)&d=.*$ [OR]
RewriteCond %{QUERY_STRING} ^&?c=(l?v?i?&d=|v&fnot=|setup&ref=|l&r=|d&d=|tree&d|t&d=|e&d=|i&d=|codes|md5crack).*$ [OR]
RewriteCond %{QUERY_STRING} ^(.*)([-_a-z]{1,15})=(ls|cd|cat|rm|mv|vim|chmod|chdir|mkdir|rmdir|pwd|clear|whoami|uname|tar|zip|unzip|tar|gzip|gunzip|grep|more|ln|umask|telnet|ssh|ftp|head|tail|which|mkmode|touch|logname|edit_file|search_text|find_text|php_eval|download_file|ftp_file_down|ftp_file_up|ftp_brute|mail_file|mysql|mysql_dump|db_query)([^a-zA-Z0-9].+)*$ [OR]
RewriteCond %{QUERY_STRING} ^(.*)(wget|shell_exec|passthru|system|exec|popen|proc_open)(.*)$
RewriteRule (.*) – [F]

Just tried navigating to the /2/ directory with a completely blank htaccess file so it can't be anything in there. Any other suggestions on finding the cause?

Edit 2 - disabled all plugins via the database and I appear to have access.
 
Last edited:
From memory, I think there's a hardcoded reference in the database (I don't remember the exact table, but I think it was something obvious like 'Settings')

Edit: This is what I was talking about, you need the wp_options table in your duplicate db. Then follow the instructions in the link for option 2
 
Last edited:
Back
Top Bottom