[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Changing WordPress 4.0.1 Permalinks Breaks Sites Menu

Posted on 2014-12-17
10
Medium Priority
?
232 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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 2000 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

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

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

It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
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…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
Suggested Courses
Course of the Month10 days, 9 hours left to enroll

612 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