Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Changing WordPress 4.0.1 Permalinks Breaks Sites Menu

Posted on 2014-12-17
10
209 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: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mac/Safari 10 does not load all images on website 8 72
More Than One Website On Same DMZ Server 3 85
move widget title down 4 25
Remove a page from Google? 2 19
I want to start by talking about the use of plug-ins for WordPress. I started a web-site for a company I was working for a few years ago; I had extremely basic knowledge of HTML. I am a Graphic Designer by trade so I invited the opportunity as a cha…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

860 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