Two domains on same WP site, but different header - wordpress

I'm using Wordpress for a client's website and this client asked me if he could have two domains with the same content, but a different logo on top of the page. So for example:
www.website1.com with logo1
www.website2.com with logo2
Both with same theme & contents.
I was thinking of a double WP install, but then you have to do every change two times. I read something about multisites in Wordpress, but could not find out how to do this.
I hope someone can help me out, thanks!

On the SEO front this is a bad idea, you will duplicate all content Google won't know what to value more. But if you really want it.
you could do this with two wp install's but there are problems.
First set your site url's in the wp-config
Second let both installs connect to the same database. The change in
header can be detected with $_REQUEST (google it)
Now there are 2 problems left which I don't know how to fix.
The uploads folder need to be synchronized so each site can access the uploads
the solution will be with simlinks stuff. (which I'm not familiar with)
And your hosting provider has to allow it.
If you add an internal link in your post/pages it will prepend the complete site url, and save this hard coded in the database.
The solution of this could be in the editor, of to filter the content before it is printed.
If you want to go this way I'm willing to look further into these problems

Here is a relatively recent article on how to set a multisite wordpress network up.

Related

My wordpress website being hacked with code eval($_SERVER['HTTP_81DB2B3']

I have a problem with my website, I get information from wordfence about my WordPress website getting hacked
enter image description here add found a code eval($_SERVER['HTTP_81DB2B3'] so i removed it but in a few second the code going back. someone, please help me
I had something very similar to this. Go to your cPanel and search for "Cron Jobs" and scroll down to see if there's any malicious cronjobs setup. You might have some that look like eval(gzinflate(base64_decode(.... that are essentially causing this to reoccur. Not a complete fix to this issue, but you'll have to delete those cronjobs to ensure that that line of code doesn't keep reappearing. In addition to that, you'll also need to make sure those cronjobs don't show up again. Use a plugin like Wordfence (suggested above as well) to look for malicious files and if it helps replace your home directory (except for wp-content and wp-config) with fresh files.
If your website got hacked then I guess more than 1 file was affected by it,
case-1: If you are able to access the Wordpress Backend In this case, if you are able to access the Wordpress backend then I suggest you
Step-1: Add one plugin called (Wordfence Security – Firewall & Malware Scan
) and scan your website with it.
Step-2: After scanning the site remove all suspicious code from the site.
Case 2: If you are not able to access the Wordpress backend then you have to update your Wordpress manually with the hosting file manager or FTP.
Please Note: Please take a backup of your website before do any changes.

Install wordpress on subdomains

I need some help with wordpress. I have got a wordpress on my main domain and I would like to use another wordpress on my subdomains with the same theme, plugins, blog pages and posts but different links in my blog posts. I want to know how I can change the links in my blog posts for the main domain and the subdomains?
Do I need to create a subdirectory folder and a different database name for each subdomain and do I also need to copy the wordpress files from the main domain to the subddirectories folder so I could be able to create the username and password for the subdomains and then login in the wordpress for each subdomain to change the links in the blog posts?
I want you to understand that I want to use the main domain and subdomains to use the same theme, same plugins, same blog posts and same pages but the links in the blog posts have to be different, because I am going to use different traffic sources on each subdomain to track for clicks and sales, example: my main domain will be use for google traffic, the blog subdomain is for facebook and the other subdomain is for easyhits4u. I can track the clicks and sales for google and other traffic sources because the links in the blog posts for the main domain and subdomains would not be the same.
If I use the same links in the blog posts for the main domain and the subdomains, I would not know how many clicks and sales I would get from each traffic source I use and I would not know where the clicks and sales are coming from. That is why I want to use it seperate so I can track it easy.
To go a little further about the comment of #Sysix :
As far as I know, Wordpress Multisite allow you to have one folder that hold all of your websites. Your websites url can be subdomains or subfolders based (but this one not need to have a real subfolder, it's only about the url)
subdomain.example.com
example.com/subdomain
At my last work, the php developper made a plugin or something that allow you to have different urls for each site of the network.
example.com
example2.com
etc.
(I'm gonna search some informations about it, if you are interested in)
Websites are handled with the database only, and if you take a look at the wordpress database after you have create a new site in the network, you will get new tables wp_posts, wp_meta etc. with a number after them that is related to the site id.
So i think that the best way for you is to make one website, create all the post, the pages, and when it's done, duplicate it in a new site in the network.
You can use the plugin in the link below to duplicate a site of your network.
https://fr.wordpress.org/plugins/multisite-clone-duplicator/
Just a warning : I know that this way it could works, but I also know there some conditions to make it works great. I can't remember exactly why but I seem to recall that you can't easily duplicate the main website of the Network. There was a workaround to do it but I don't remember exactly what was the issue, and how to resolved it.
I'm gonna search and test some stuff right now, so this answer is not definitive but it could get you on the way. I will edit it if i find or remember some important thing.
Sorry for this answer that is not really an answer, but in comment it was not possible to write all this ... Also if I said nonsense, please correct me, and I will edit the post as well.

Move wordpress installation from subdomain to root and keep links

ok this is bit weird question:
here is my domain: hfarazm.com
and wordpress installation at: blog.hfarazm.com
I have lots of visitors and they have shared my blog and article links all over.
I want to organize my site for separate section for tutorials, for blog, for portfolio and for other things.
Right now everything is going to blog.hfarazm.com i want to move blog to root but want to keep links so that users dont see 404 page and i get a chance to manage my site from the root.
I know: changing url in settings of wordpress will do the job but is redirecting is good practice? what is the better solution to achieve this confusing state.
You can create an .htaccess rules so your visitors will be redirected to new location, even if they type the URL blog.hfarazm.com.
See detailed information here.
Note that many of these examples won't work unchanged in your particular server configuration, so it's important that you understand them, rather than merely cutting and pasting the examples into your configuration.

how do i prevent hotlinking of images in my wordpress site?

I have a wordpress website hosted on byethost.com which runs on a free account, now what the problem is that on some computers it shows that image hotlinking is disabled on my plan, is there a way to change my urls of images whithout giving my websites link, or i'll just have to upgrade my plan??
You should add an entry to your .htaccess. This page has a handy generator that will write he rules for you.
As always with making changes to .htaccess, make sure you back it up first, and don't put it in between the comments added by WP, since they may get over written

WordPress with Yahoo! Hosting... Almost there

EDIT:
Yeah, so this problem is really unsolvable. Yahoo prevents access to .htaccess, even from WordPress itself trying to change it. I had to settle for writing a script on the default homepage that redirects browsers to "www.abc.com/index.php" if they go straight to "www.abc.com". You always have to deal with "index.php" being in the address bar but it's better than not having permalinks...
/EDIT
Yahoo! Small Business hosting seems specifically engineered to make WordPress difficult-- but it's my client's host and there's not much I can do about it. I'm trying to move WordPress into the root directory, and I'm sooo close to having it done.
I've read and read and read about how to get the Permalinks to work right, and since Yahoo! hosting doesn't let you modify htaccess I am pretty much up s*** creek. I'm using the simple permalink structure of "/%postname%/", which once I moved to the root, stopped working. I have changed it to "/index.php/%postname%/", which allows you to see the pages if you manually type in index.php before the page name or if you are logged into the admin area and "View Page". Also, the correct permalink shows on all of the pages in the editor.
However, WordPress doesn't let you change the permalink of the static page you use as the front page.
Long story short, if I go to "www.abc.com/index.php", the links in the menu all work fine. However, if I just got to "www.abc.com", the links don't pick up the "index.php" from the permalink structure. I need to fix this, so if anyone knows how to either:
Change the permalink of the static front page
Fix something in the database if I install PhpMyAdmin
Work around not having access to .htaccess
Put a small script somewhere on the index page to append "index.php" to the url
Any other suggestions
It seems it would work if I was NOT using a static front page but rather the blog, but this isn't an option. I've tried changing the "Tag base" setting to no avail, as well as deactivating the Yahoo! Custom Permalinks plugin (and reactivating it again after that failed...). Could really use some help!
Check out Giving Wordpress its own directory. I can see how this could solve your problem. Also make sure that you have done the obvious, and change your url for WordPress address (URL) Site address (URL) inside the general settings page. Perhaps the static homepage should be developed outside of wordpress, and then you can follow the steps provided in the link I provided. Hope this solves your issue.
Yahoo doesn't allow users access to the htaccess file which means that you can't the mod_rewrite rules needed for custom permlinks. The Only way around it that i've heard it works (never tried it myself) is to add /index.php/ to the beginning of your custom structure so: Go to Permalink Settings > Select Custom Structure. And set the value as /index.php/%postname%/ or what ever you want as long as you add /index.php/ before it.
Hope this helps.
I had a similar problem with this host (in 2018! 4 years after your question) that I finally solved by changing the permalink settings.
Settings > Permalink Settings > Custom Structure: /index.php/%postname%/
I wish there was a better solution but Yahoo Small Business still doesn't allow .htaccess files - after several frustrating rounds with customer service, I finally admitted defeat and used this work around.

Resources