Solved

Changing WordPress 4.0.1 Permalinks Breaks Sites Menu

Posted on 2014-12-17
10
206 Views
Last Modified: 2014-12-18
After installing WordPress, and getting halfway through my project, I discovered "permalinks". As an expert would know, the default is to reference pages with ?page_id=nnn. I discovered in the settings there is a "more friendly" look of simply using the page name, or "post name" it is called.

When I chose the permalink "post name" option, the menus stopped working.

I have searched the internet looking for answers. I have found tons of hits. they refer back to an apache server file named ".htaccess". This file is located in the root of WordPress. It contains two entries: BEGIN WORDPRESS, END WORDPRESS
I have tried to make sense from the searches I have found. Nothing makes sense to what I have seen.

Could someone tell me what I should put in that file to allow me to change permalinks to a "friendly page name"? A sample entry would be appreciated. My pages start out with names like "?page_id=114, and on up to 14 pages.
0
Comment
Question by:RayRider
  • 5
  • 5
10 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40506165
Are your Permalinks on or off right now?  If off, turn them on and then check the .htaccess file.
0
 

Author Comment

by:RayRider
ID: 40506189
I assume they are on. I go to setting->permalinks and see the radio button selecting "default". When I select "Post-name", that is when the menu stop working. Apache gives the error "site not found".
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40506193
Default = Permalinks off

So now the entire site stops working when you turn them on, not just the menu?
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:RayRider
ID: 40506234
The site stops working in respect that the site has NO problem launching from the base URL, www.sitename.com, However, when I click on a menu button (from the home page), I get the "not found" error. I have designed the site with anchors to paragraphs in the middle of pages using  html tag <a name="middlepage_target"></a>. Those anchor tags don't work, either.

I cannot find in WordPress anyway to configure it to work changing from the ?page_id=nnn, which you say is the default, meaning "off".

I guess I am misunderstanding what permalinks actually are. If I chose a permalink such as the "post-name", I have no clue what to do. I know that apache has to route the request to the virtual site. The configuration in apache's site-available only knows about either sitename.com, or alias of www.sitename.com.  So, if apache can route the request by using the non permalink name (?page_id) address, surely it can route the permalink "post-name" format, meaning it is something in WordPress that is not able to route using on of the permalink formats.

I bet the problems is in mySQL. I am guessing the database if looking for the raw routing = ?page_id=nnn

WordPress has no problems taking the non permalink address (www.sitename.com/?page_id=114#middlepage_target

This post has gotten too wordy. I hope I haven't totally confused you.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40506251
You're all over the place.

Do this.  Turn permalinks on (set to Post Name) and then look at the .htaccess file and paste the contents here.

When you created the menu, you did it all with custom links?
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40506283
.htaccess should look like this:

# 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

Open in new window

0
 

Author Comment

by:RayRider
ID: 40506295
After setting to permalinks to Post-Name, here are the contents of .htaccess:

rrider@greece:/var/www/wordpress$ cat .htaccess

# 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
rrider@greece:/var/www/wordpress$

Turning permalinks back off, here are its contents:

rrider@greece:/var/www/wordpress$ cat .htaccess

# BEGIN WordPress

# END WordPress
rrider@greece:/var/www/wordpress$

Not sure what you mean by "custom links". I do not necessarily want a "blog site". this site is mostly static pages that I will update myself with maybe a comment page for user feedback and posts. All I did was create several pages. Next, I went to dashboard, appearances, menu and laid out the menu in the order I wanted it to look, including a couple of submenus. That is it! Nothing else.

I am a newbie with quite of bit of reading and video training in WordPress. However, this is my first site after I installed the server. I have been around IT for a long time. I just never did much web development, especially CMS.

This site is coming along just fine, and will continue just great even if I must stick with permalinks off. I just found it a bit intimidating to me because I never needed a use for the .htaccess file. After googling it, I was no better off understanding what it does to solve the permalink issue. That's why I came here to Experts Exchange.
0
 

Author Comment

by:RayRider
ID: 40506305
I see my .htaccess is the same as yours. What about permissions? Mine is:
-rw-r--r--  1 www-data www-data   36 Dec 17 21:41 .htaccess
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 500 total points
ID: 40506336
Permissions and .htaccess are not the issues.

Try this:

Turn permalinks on (Post Name).

Go to Appearances | Menu and delete your current menu

Rebuild the menu
0
 

Author Comment

by:RayRider
ID: 40507486
Thanks for the help.

Unfortunately, redoing the menu did not solve the problem.

Looking at my apache logs, apache is rejecting the "post name" format with a 404. If I knew more about the data flow, maybe I would continue to troubleshoot this.

From a curiosity point, I would like to solve this. But, from a practical point, I have spent too much on this. I can make it work without permalinks.

Many help blogs, including WordPress continue to point to .htaccess when links are broken from going to permalinks. Maybe on the next new site I will try them again.

Thanks again!!
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
This video teaches users how to migrate an existing Wordpress website to a new domain.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question