[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 224
  • Last Modified:

Changing WordPress 4.0.1 Permalinks Breaks Sites Menu

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
RayRider
Asked:
RayRider
  • 5
  • 5
1 Solution
 
Jason C. LevineNo oneCommented:
Are your Permalinks on or off right now?  If off, turn them on and then check the .htaccess file.
0
 
RayRiderAuthor Commented:
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
 
Jason C. LevineNo oneCommented:
Default = Permalinks off

So now the entire site stops working when you turn them on, not just the menu?
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
RayRiderAuthor Commented:
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
 
Jason C. LevineNo oneCommented:
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
 
Jason C. LevineNo oneCommented:
.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
 
RayRiderAuthor Commented:
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
 
RayRiderAuthor Commented:
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
 
Jason C. LevineNo oneCommented:
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
 
RayRiderAuthor Commented:
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now