This is the 5th in a 5 part series on Creating a Local Installation of WordPress using Bitnami and then creating a Netbeans Project out of it. In this lesson we modify our local Apache httpd.conf file to allow Pretty Permalinks. Once we enable them locally we set the permalinks in our WordPress Installation.
How to Create a Local Installation of WordPress – Part 2 – Adjust Windows Permissions
How to Create a Local Installation of WordPress – Part 3 – Modify the php.ini file
How to Create a Local Installation of WordPress – Part 4 – Create a NetBeans Project
How to Create a Local Installation of WordPress – Part 5 – Enable Pretty Permalinks
Now there is another thing though that you’re going to want to do because now we’ve created our NetBeans project, now you want to enable the pretty permalinks. Because right now, you can only use the standard permalinks that is stage id such and such. and so, in order to enable pretty permalinks, we need to turn off Apache because it’s right now running as a Windows service. We need to turn off Apache and we’re going to need to edit the httpd.conf file in this Apache server.
And so the first thing to do is to go to Windows services, I have it set up on Administrative Tools and what we want is… so there’s the services icon right there. It’s actually local services that we’re going to want to change and you can see the local right there, it’s already set up for us. Give myself a little bit more room and now we want to find that WordPress Apache service and it’s alphabetical so just go down to the bottom to WordPress. Now you can see that I’ve got a WordPress Apache 1, 2, and 3 and it’s the 3… remember that was created. Apache 1 and Apache 2 were created by my 3 previous installations so it’s WordPress Apache 3 and what we want to do is stop it. So you right click on it and select stop and wait for it to stop.
So you can’t edit this file if it has not been stopped. So now we come back over here and we want to open up this file. So again, back to Notepad, we’ll open the file and the file we want to open this time is up in Bitnami stack 4 Apache 2 and then htdocs… no, oops, pardon me. We’re just going to undo test, go to All Files, no it’s not under htdocs. Which file is it? Apache 2 conf, that’s what it was. So Apache 2 conf and then httpd conf.
Okay and so then what you want to find is the load module rewrite module modules. And so, if you search for that, what we do is we take this pound sign off of it. The pound sign makes it a comment, we’re going to take it from here and it could be that it’s already done. Let’s just fine the next… you can see right… where to go? Shoot. Find the next, okay. You can see it says load module rewrite module, it does not have the pound sign in front of it. So that’s actually already done here. It didn’t use to automatically do that with Bitnami but now, it looks like it is. But in any case, that’s how you… that’s one of the things you have to do in order to have pretty permalinks.
Then the next thing you need to do is to find this directory with options follow same links, allow override none. And so, and change it to allow override all. So if we again, go back to this and paste that, so we want allow override and we look for the next one. Here it is, it says allow override none, we’re going to change that to all.
And actually, there’s another instance of this allow override and I don’t think it matters that much but you can go to this other instance of the allow override right down here and say all as well. And then save this. So had we not stopped the Apache server, we would not have been able to save this file so that’s why we did that.
So now, we need to restart the Apache server. So we go back to the Windows Services again here and we’re still on Apache 3. If we refresh, right click on that and say start, it starts that Windows service up. Okay and so, now we can go back to our website and go to our dashboard, well actually, first off, let’s just see… you can see that if we go to that post, it says you know, ?p=1, right?
So now what we’re going to do is we’re going to change our permalinks. So we go to our dashboard, we go down to settings and permalinks and if we pick month and name first here and then go to custom structure and do this thing I recommend everybody do which is change out year for month num and then change month num for category and hit save changes.
Okay now, we have a new permalink structure so for example, if we go back to our live answers here and go to this post, now we can see month 05, it’s uncategorized. So the uncategorized category shows up and then the name of the post. If we go to our page, we’ve got one page created here, right? So if we go to pages and we look at our sample page, you can see that it’s wordpress/samplepage. And so, rather than the p=? thing.
And so that’s pretty much it. It’s the 6 steps of setting up a local copy of your WordPress or a local copy of WordPress on your site and making it a part of your or making it a project in NetBeans.