Title: Permalinks generation error
Last modified: August 18, 2016

---

# Permalinks generation error

 *  [Alex Petrenko](https://wordpress.org/support/users/petrenkocomua/)
 * (@petrenkocomua)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/permalinks-generation-error/)
 * Dears,
 * I’m stuck. Recently (yesterday) I moved my site to new hosting. Main difference–
   Apache2, so I expected, that lot (some) of problems with permalinks will disappear.
 * But, what I see: permalinks, that were previously generated correctly, generated
   in strange way:
 * Instead of creating link (in title and “more..”) to [http://wwwua.petrenko.com.ua/seen/graffity/chicken-little/](http://wwwua.petrenko.com.ua/seen/graffity/chicken-little/)
   it creates link to [http://wwwua.petrenko.com.ua//chicken-little/](http://wwwua.petrenko.com.ua//chicken-little/)
 * In permalinks structure – /%category%/%postname%/…
 * Moreover, long link ([http://wwwua.petrenko.com.ua/seen/graffity/chicken-little/](http://wwwua.petrenko.com.ua/seen/graffity/chicken-little/))–
   works…
 * Can you suggest something? I will be very thankfull 🙂

Viewing 14 replies - 1 through 14 (of 14 total)

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293350)
 * What are your two URL options in Options/General?
 * Also, was “Chicken Little” posted under a category?
 *  Thread Starter [Alex Petrenko](https://wordpress.org/support/users/petrenkocomua/)
 * (@petrenkocomua)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293362)
 * Blog and wordpress adresses are the same: [http://wwwua.petrenko.com.ua](http://wwwua.petrenko.com.ua)(
   no trailing slash).
 * Yes, Article posted under category and seen witin category list.
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293365)
 * Interesting. Do the permalinks work properly without the `/%category%/` tag?
 *  [cron](https://wordpress.org/support/users/cron/)
 * (@cron)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293381)
 * You might want to check your WordPress address (URI) and Blog address (URI) in
   the options section and check they are both right. WordPress bases the first 
   part of the permalinks off them so….
 *  Thread Starter [Alex Petrenko](https://wordpress.org/support/users/petrenkocomua/)
 * (@petrenkocomua)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293383)
 * 2 macmanx. Yes. Problem with %category% tag only in any combinations.
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293434)
 * That’s very odd. The `/%category%/` tag was known to be unstable under Apache
   1, but it should work perfectly under Apache 2. I think that you should submit
   this as a bug report.
 * [http://codex.wordpress.org/Submitting_Bugs](http://codex.wordpress.org/Submitting_Bugs)
 *  Thread Starter [Alex Petrenko](https://wordpress.org/support/users/petrenkocomua/)
 * (@petrenkocomua)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293437)
 * Probably that was raised here: [http://trac.wordpress.org/ticket/1199](http://trac.wordpress.org/ticket/1199)
 * Strange… In Apache 1 we had a problem with work of permalinks, In Apache 2 we
   have problem with permalinks show up.
 *  Thread Starter [Alex Petrenko](https://wordpress.org/support/users/petrenkocomua/)
 * (@petrenkocomua)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293440)
 * BTW, anybody can show the place, where these links are generated? In my opinion
   there should be no problems with generation.
 *  Thread Starter [Alex Petrenko](https://wordpress.org/support/users/petrenkocomua/)
 * (@petrenkocomua)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293460)
 * So, I experimented about for a while: made couple of fresh installs on different
   urls on the same server – the same situation – %category% is missing.
 * I have access to server configuration (VDS). May change of some settings help?
 *  Thread Starter [Alex Petrenko](https://wordpress.org/support/users/petrenkocomua/)
 * (@petrenkocomua)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293470)
 * Continuing the story…
    Changed settings to be equal on previous host. Not working.
 * Looked into code.
    It happens here: /wp-includes/template-functions-links.php`
   $category = ''; if (strstr($permalink, '%category%')) { $cats = get_the_category(
   $post->ID); $category = $cats[0]->category_nicename; if ($parent=$cats[0]->category_parent)
   $category = get_category_parents($parent, FALSE, '/', TRUE) . $category; }
 * But why the category name is empty?
 *  Thread Starter [Alex Petrenko](https://wordpress.org/support/users/petrenkocomua/)
 * (@petrenkocomua)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293485)
 * So I see, that there are similiar problems
    here: [http://wordpress.org/support/topic/26500](http://wordpress.org/support/topic/26500)
   and here [http://wordpress.org/support/topic/26870](http://wordpress.org/support/topic/26870)
 * But I again want to note: ALL PERMALINKS WORK CORRECTLY IF PROPERLY GENERATED(
   it is not problem in .htaccess rules).Problem is that %category% tag is not shown
   in URL like in post [http://wordpress.org/support/topic/26500#post-151327](http://wordpress.org/support/topic/26500#post-151327)
 *  Thread Starter [Alex Petrenko](https://wordpress.org/support/users/petrenkocomua/)
 * (@petrenkocomua)
 * [20 years, 6 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293540)
 * Sorry for spam, but I have no news or ideas… Do you?
 *  Thread Starter [Alex Petrenko](https://wordpress.org/support/users/petrenkocomua/)
 * (@petrenkocomua)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293544)
 * Just installed WP2. The same problem.
 * My new observations.
 * In file `template-functions-links.php`
    `$cats = get_the_category($post->ID);`–
   returns table (array), where categories matching post ID shoild be.
 * `$category = $cats[0]->category_nicename;` – should take from this table (array)
   first match nicename for category.
 * BUT in fact, it should take instead of [0] (means first row), row with category
   number. So, I understand, that function `function get_the_category($id = true)`
   in `template-functions-category.php` works incorrectly on some hosts or with 
   some settings, selecting ALL categories, not the one.
 * I understand, that you are working hard on WP2, but now it is proved to be a 
   bug in WP2 too 😉
 *  Thread Starter [Alex Petrenko](https://wordpress.org/support/users/petrenkocomua/)
 * (@petrenkocomua)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293611)
 * Anyone has PHP 4.2 to check, whether it relates to PHP version?

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Permalinks generation error’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 14 replies
 * 3 participants
 * Last reply from: [Alex Petrenko](https://wordpress.org/support/users/petrenkocomua/)
 * Last activity: [20 years, 4 months ago](https://wordpress.org/support/topic/permalinks-generation-error/#post-293611)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
