Change all wordpress permalink url in database - jekyll

First of all i know that wordpress will redirect from old permalink to new.
But if I'm not using WordPress the old permalink will be dead.
In example
http://www.example.com/%postname
I have changed to
http://www.example.com/%year/%date/%postname
In wordpress all traffic from old will be redirect to new but in database was not changed it's still old. Jekyll can't do this.
I want to fix this thing can anyone guide my way?
(I do this because I'm migrating to jekyll everything is OK but this one)

There is a plugin for redirects in Jekyll.
You can simply create a _redirects.yml, _redirects.htaccess, and/or _redirects.json file and set initial page address with an old link and a destination page with a new link.

Related

Best way to add a Hugo blog to an existing static site?

The Situation
I have a website hosted on Netlify that consists of HTML and CSS files only. Let's call it "domain.com".
I want to keep that website the same, but add a Hugo blog only on "domain.com/blog/".
What I've Tried
I've created a folder called "blog" in my "domain.com" repository and copied over all of the Hugo stuff. Then I go to Netlify's build settings and told it use Hugo to build it. I don't think this works because it's looking for a config.toml file in my root folder, which isn't there, it's in the blog folder.
Then I tried creating a new Netlify site build from the /blog/ directory of the repository with the build setting "hugo --gc --minify". This doesn't work either and definitely doesn't put the the blog at "domain.com/blog/".
What I'm Wondering Now
Is this even possible?
Would I have to just start the whole thing from scratch and start from Hugo?
Is there a better way to create a CMS on "domain.com/blog/" that's free and not Hugo?
Since asking this question I have realized that it's not a good question. I'll keep it up though in case somebody has the same thought process as I did. It's not about getting Hugo onto an existing site, it's about getting your existing site onto Hugo.
I ended up porting my existing index.html and other pages with CSS over to Hugo. Basically I just copied those into the root of my Hugo site so they look exactly the same as they did before.
The only thing that is really generated by Hugo is the blog, which is the end result I needed.

Can't add a page in Wordpress after website migration (I changed my host file so I can work on my website before transforming to my new host )

I changed my host file so I can work on my Wordpress website before my website is transforming to my new host. I had already make my website in Wordpress with the page builder: Elementor. So I used 'all in one migration' to migrate that website to this one. It migrated perfectly, but the only thing is that I can't add a page or post. When I want to publish I got an error thats says that he has no legit json reaction.
I think because the host file he can't handle sub url's, so when the website is transformed I can publish pages. Is this the problem or is the problem the migration?
I hope so someone can help me out.
thank you in advance!

Can't find pages' URL after database renew Wordpress

I have a Wordpress site since a couple year hosted on a trusted domain. A couple weeks ago i forgot to renew my mySql database and obviously the site went down. To give my user a way to contact my shop i created another index.php and, after saving the old index.php given by the Wordpress theme, i deployed it on the server using Filezilla. Yesterday my domain was renewed and they told me everything is working, so i deleted my new index.php page and i deployed back the one got from the WP theme.
Now the home page works wonder, but if i try to show any other page i get a "Not Found - Requested URL was not found on this server". I tried to create another simple page to see if that works, and i get the same error. I didn't change anything in my file system bar index.php, and i'm pretty sure that's the one i used to have before my database went down.
Any ideas?
First of all, thanks #mevius for your answer. Unfortunatly that was one of the first things i tried and it didn't work. What i ended up doing was download the content of my MySql DB and exported all the tables into another DB that shared the host with the first one. After doing that i edited the wp-config file changing the DB name and my website works like a charm again. Thanks!

jekyll pretty permalinks give me WEBrick error

I am developing my blog in Jekyll (3.0.0 beta), currently on localhost,
When i am trying to implement the pretty permalink and i try to visit a post it shows a WEBrick error.
If i apply the /:year/:month/:day/:title.html it works fine do you have a clue why isn't it working with pretty permalinks?
This is the error I get:
/2015/08/03/are-permas-working.html' not found. WEBrick/1.3.1 (Ruby/2.1.6/2015-04-13) at localhost:4000
Once you set Jekyll permalinks to pretty in _config.yml like so:
permalink : pretty
... and restart your WEBrick server (a restart of the server instance using jekyll serve or bundle exec jekyll serve [if following GitHub] is needed for the new values to take effect, your permalinks will no longer be in the format of YYYY/MM/DD/title-slug.html since they are now "pretty". The new format for your links will be /:categories/:year/:month/:day/:title/. This is in accordance to the format determined by the pretty variable as defined here in the documentation.
What this means for you is that your original link for the 'Are permas working' post is no longer at localhost:4000/2015/08/03/are-permas-working.html, rather they are now at localhost:4000/2015/08/03/are-permas-working/ since you don't have a category defined.
You're experiencing this error because after you've made the change and restarted your server you most likely did not navigate to the post from your homepage (which will have that new link to point to the post), rather you just refreshed the page on your browser, which will throw a 404 since the page is no longer there.
Bonus, Jekyll makes posts pretty by creating folders 2015 -> 08 -> 03, and then a folder for that specific post, with an index.html inside it.
Also, if you wanted "pretty-fied" links that don't have the dates there, you'll need to manually specify that using this:
permalink: "/:categories/:title"
This ensure will hide the .html extension and also get rid of date values.
EDIT: From the comments I stated that using /:title for permalinks might not work since there are conflicts with non-post pages, I stand corrected. If you wanted short permalinks like user.github.io/title-of-blog-post/ you would just need to set permalink : /:title and you're good to go. However, if you have non-post pages such as an about page, a credits page, you should explicitly set permalinks on those pages to be /about and /credits on the YAML frontmatter to avoid the edge case of also having a blog post with the title about and accidentally overwriting the non-post page.

incorporate wordpress into a website

Can you please shed some light on incorporating word press into the site.
Here my requirement is..i have a tab called 'my blog' in my website.
When the user clicks that button he able to see the name of my blog
and my posts and archives and also tags..these much information i want.
I don't want to use complete word press in my site.
This is really simple. Follow my instructions.
Login to your cpanel.
Create a folder named blog in your root.
Upload the latest version of wordpress you downloaded from
WordPress.org.
Unzip it to the blog folder. (Make sure to move all files outside
the folder wordpress)
Create a MySQL database and add a user to it. Make sure to keep the
database name, username and password. For most of the server the
hostname will be localhost.
Now go to www.example.com/blog and just follow the instructions
there and Run the installer.
Now you can login into your WordPress Dashboard.
Search google for some free wordpress themes and install one of the
themes in Theme section in Dashboard.
Now your wordpress blog is ready. In your site for the blog tab
give the link as www.example.com/blog.
Reference Links:
Famous 5-minute installation - WordPress
Cheers !!!
Assuming you are self-hosting, and have access to your controls;
You will need to create a new MySQL database, and safely store your database name, username, hostname and password for later.
You will have to download wordpress http://wordpress.org/, and follow the installation instructions also found at http://wordpress.org/.
In order to do what I think you're wanting to do, you will need to create a new theme by creating a new folder in your Content > Themes folder, and move ALL your site files into this new directory.
Add to your CSS file to make it an applyable 'theme':
/*
Theme Name:
Theme URI:
Author:
Author URI:
Description:
Version:
License:
License URI:
*/
You will then have to assign this new theme to Wordpress, and create at least two template files,
category.php
single.php
Within these two templates is where you will loop through your posts, and display your full posts, respectively.
This isn't a graceful solution, however, it will do what you want it to in a rudimentary way. It would be better to develop a proper theme for your site, and fully take advantage of Wordpress as a CMS, and not just a blogging platform. There are lots of resources on how this is done, and it may seem overwhelming but start small, that's how you learn.