标签: permalinks

Wordpress永久链接结构改变问题

我已经看到关于这个问题的其他一些帖子,但是没有一个建议的解决方案对我有用,所以我重新发布.

将永久链接结构更改为/%postname%/,没有链接正常工作.我得到以下404:

Not Found

The requested URL /my-post-name/ was not found on this server.

Apache/2.2.20 (Ubuntu) Server at mysite.com Port 80
Run Code Online (Sandbox Code Playgroud)

当我回到default固定链接结构时它又开始工作了,但我想要有/%postname%/结构.

我的.htaccess档案chmod是777.

更新我的固定链接结构后/%postname%/,.htaccessWordpress生成的文件如下:

# 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
Run Code Online (Sandbox Code Playgroud)

有什么想法吗?

编辑:

我试图将永久链接结构更改为以下内容:

/index.php/%postname%/
Run Code Online (Sandbox Code Playgroud)

它很愉快地工作.但是,问题现在,毫不奇怪,链接的形式如下:

www.mysite.com/index.php/my-page.com
Run Code Online (Sandbox Code Playgroud)

我的问题是如何index.php从链接中删除.当我从永久链接结构(即/%postname%/)中删除它时,我的链接不再起作用.

PS:我没有使用博客条目,而只使用我网站中的网页.如果有必要,我的网站是:mll.sehir.edu.tr.

wordpress .htaccess permalinks

7
推荐指数
2
解决办法
1万
查看次数

WordPress自定义帖子类型存档 - <post type> .php无法正常工作

WordPress新手,我一直在尝试为自定义帖子类型创建一个存档页面,当我点击链接时,localhost/websitename/wordpress/archive-event.php我得到一个404.这是我注册帖子类型的代码:

add_action('init', 'event_register');

function event_register() {

    $labels = array(
        'name' => _x('Events', 'post type general name'),
        'singular_name' => _x('Event', 'post type singular name'),
        'add_new' => _x('Add New', 'event'),
        'add_new_item' => __('Add New Event'),
        'edit_item' => __('Edit Event'),
        'new_item' => __('New Event'),
        'view_item' => __('View Event'),
        'search_items' => __('Search Events'),
        'not_found' =>  __('Nothing found'),
        'not_found_in_trash' => __('Nothing found in Trash'),
        'parent_item_colon' => ''
    );

    $args = array(
        'labels' => $labels,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true, …
Run Code Online (Sandbox Code Playgroud)

php wordpress permalinks custom-post-type

7
推荐指数
1
解决办法
1万
查看次数

一般的wordpress链接过滤器

大家!我需要添加域名前缀www,而不是手写,每个过滤器为post_link,page_link,category_link等等 - 所有网址都有一个全局过滤器添加www.如何更改数据库中站点URL的常规设置或更改选项或htaccess的方法 - 只是不适合.在此先感谢您的回复.

wordpress permalinks

7
推荐指数
1
解决办法
3979
查看次数

如何使用monthname创建永久链接而不是使用monthnum?

我想重定向我的博客文章,

http://www.example.com/blog/2014/september/03/post-name

但在wordpress中它只允许我使用月号,

http://www.example.com/blog/2014/09/03/post-name.

我正在寻找这个,但没有找到任何有用的东西.一些未答复的帖子,他们甚至没有说,是否有可能.即使在wordpress文档中也没有参考.我找到了以下代码,但它更改了网址但未链接帖子页面.

<?php
/**
* Plugin Name: Month Name
* Description: Enables the <code>%monthcode%</code> and <code>%monthname%</code> tag for Permalinks.
* Author: Roger Chen
* License: GPLv2
*/

/**
* Enables use of monthname (january, june) and monthcode (jan, jun).
* Supports permalinks in the form of /2016-nov/61742/..slug.. or /2016-november/61742/..slug..
*/
class MonthName {

/**
 * Month Names
 */
public static $monthnames = array(
    'january',
    'february',
    'march',
    'april',
    'may',
    'june',
    'july',
    'august',
    'september',
    'october',
    'november',
    'december',
); …
Run Code Online (Sandbox Code Playgroud)

php wordpress permalinks

7
推荐指数
1
解决办法
1217
查看次数

在WordPress中仅为自定义帖子类型的固定链接显示特定类别

我试图在Wordpress Devlopment网络中提出这个问题没有成功,我试图在固定链接类型的永久链接中只显示3个特定类别.

现在,永久链接结构(即我正在使用的主题给出的结构以及我通过子主题修改的结构)如下:

www.myfoodblog.com/recipes/the-post-title/
         ^            ^           ^    
       root   custom-post-type  title  
Run Code Online (Sandbox Code Playgroud)

一些帖子属于3个类别,我想在永久链接中显示restaurant,users并且admin得到类似的东西

www.myfoodblog.com/recipes/restaurant/the-post-title/

www.myfoodblog.com/recipes/users/the-post-title/

www.myfoodblog.com/recipes/admin/the-post-title/
Run Code Online (Sandbox Code Playgroud)

将原始结构留给不属于这些类别的帖子.

我尝试使用此插件,但它会显示所有帖子的自定义帖子类型类别.

我也尝试按照此问题中提供的说明进行操作,但它不起作用,永久链接结构中没有任何更改.

任何建议都非常感谢.

wordpress permalinks custom-post-type

7
推荐指数
1
解决办法
1262
查看次数

如何以编程方式更改 WordPress 的默认帖子永久链接?

在 WordPress 的后端,我使用默认http://localhost/sitename/example-post/值来创建永久链接。

对于自定义帖子类型,我以这种方式定义了自定义 slug,例如services

register_post_type( 'service',
    array(
        'labels'      => array(
            'name'          => __( 'Services' ),
            'singular_name' => __( 'Service' )
        ),
        'public'      => true,
        'has_archive' => true,
        'rewrite'     => array(
            'slug'       => 'services',
            'with_front' => true
        ),
        'supports'    => array(
            'title',
            'editor',
            'excerpt',
            'thumbnail'
        ),
        'taxonomies'  => array( 'category' ),
    )
);
Run Code Online (Sandbox Code Playgroud)

它创建services/post-name

我还使用此挂钩创建自定义页面来创建自定义页面永久链接:

function custom_base_rules() {
    global $wp_rewrite;

    $wp_rewrite->page_structure = $wp_rewrite->root . '/page/%pagename%/';
}

add_action( 'init', 'custom_base_rules' );
Run Code Online (Sandbox Code Playgroud)

它创建页面/帖子名称

现在我唯一需要做的就是为正常的 WordPress …

php wordpress permalinks wordpress-theming custom-wordpress-pages

7
推荐指数
2
解决办法
1万
查看次数

Wordpress永久链接不起作用

我将我的网站从slichost移到了亚马逊ec2.移动后我为wordpress做了必要的设置.我的第一页wordpress工作正常,但永久链接不起作用.任何人都可以让我知道有什么变化是必要的,使永久链接工作.

谢谢

wordpress permalinks

6
推荐指数
2
解决办法
6208
查看次数

Wordpress自定义类型永久链接包含分类法slug

我正在尝试为自定义类型创建一个永久链接模式,其中包括一个分类法.分类法名称从一开始就是已知的(所以我不是要添加或混合所有的分类法,只是特定的分类法),但当然,价值将是动态的.

通常,自定义类型永久链接是使用rewritearg和slugparam 构建的,但我不知道如何在其中添加动态变量.

http://codex.wordpress.org/Function_Reference/register_post_type

我猜测需要一个自定义解决方案,但我不确定最好的非侵入式方法是什么.

是否有一个已知的做法或最近有人建造类似的东西?我正在使用WP 3.2.1 btw.

wordpress permalinks taxonomy custom-type

6
推荐指数
1
解决办法
6327
查看次数

WPML>子类别页面生成404 <WordPress

问题的简短描述

所以问题基本上是当我使用wpml在网站的翻译版本中使用子类别时,它会生成一个404页面.在父类别中,我仍然可以看到帖子并导航到它没有问题.而且,在没有翻译的版本中一切正常.

我的问题

所以我的问题是,如果有其他人有这个问题,如果是这样,你是如何解决它的?


希望有用的信息

软件

  • PHP - 5.2
  • WordPress - 3.3.2
  • WPML多语种CMS - 2.4.3
  • WPML字符串翻译 - 1.3.0

永久链接设置

/%category%/%postname%/

我试过的

  • 我尝试停用所有其他插件
  • 试图冲洗永久链接< 编辑

附加信息

  • 似乎子类别的URL被视为"页面" < 编辑
  • 如果我们手动直接转到网址但从网址中减去父类别,我们会到达预期的类别存档页面< 编辑
    示例:http://domain.com/en/super/sub/- >http://domain.com/en/sub/
我的.htaccess文件:
# BEGIN Redirects
RedirectMatch 301 ^/okategoriserade/(.*)$ /webb/$1
RedirectMatch 301 ^/apache2/(.*)$ /apache/$1
RedirectMatch 301 ^/server/(.*)$ /linux/$1
RedirectMatch 301 ^/etiketter/(.*)$ /tag/$1
RedirectMatch 301 ^/kategorier/(.*)$ /$1
RedirectMatch 301 ^/en/php-en/zf2/(.*)$ /en/zf2/$1
RedirectMatch 301 ^/media/me-avatar-e1332014347355.png(.*)$ /media/erik-landvall.png$1
RedirectMatch 301 ^/jquery/(.*)$ /javascript/jquery/$1
# END Redirects

# BEGIN W3TC …
Run Code Online (Sandbox Code Playgroud)

wordpress multilingual permalinks wordpress-plugin

6
推荐指数
1
解决办法
2709
查看次数

dc.js永久链接或href共享可视化过滤器状态?

我正在使用dc.js(http://edouard-legoupil.github.io/3W-Dashboard/)处理dataviz

主要限制是,当用户在探索数据时发现特定事实时,要重现他们使用的确切过滤器以便与其他用户共享他们的发现(并启动讨论)并不容易.解决方案可能是为每个过滤器状态设置永久链接.

dc.js已经是"dc.redrawAll();" 重置所有过滤器但是有没有能力冻结某个过滤器状态并将其传递给#href?

理想情况下,这样的href将通过共享按钮或通过常规的facebook/twitter共享功能共享.

任何代码段或示例都会有所帮助!

先谢谢,爱德华

javascript permalinks href crossfilter dc.js

6
推荐指数
1
解决办法
1374
查看次数