【问题标题】:rewriting urls in wordpress .htaccess在 wordpress .htaccess 中重写 url
【发布时间】:2013-07-27 18:25:58
【问题描述】:

我是 wordpress 和服务器管理员的新手, 我刚刚在本地目录的子文件夹中安装了一个 wordpress 博客。但我在配置 .htaccess 时遇到问题。安装 wordpress 的文件夹名为 onlifestyle,位于根目录中。 我的网址具有以下形式: http://onlifestyle.org/onlifestyle/health/basic-principles-of-proper-nutrition 反而 http://onlifestyle.org/health/basic-principles-of-proper-nutrition 我的根 .htaccess 是:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?onlifestyle.org$
RewriteRule ^(/)?$ onlifestyle/$1 [NC,L]

wordpress .htaccess:

 # BEGIN WordPress
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteRule ^index\.php$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /onlifestyle/index.php [L]
    </IfModule>
#END WordPress

我使用永久链接:

http://onlifestyle.org/onlifestyle/%category%/%postname%

我应该如何配置wordpress以跳过url中子目录的名称

【问题讨论】:

    标签: wordpress apache .htaccess


    【解决方案1】:

    除了 .htaccess 文件,您必须在 Wordpress 设置中设置正确的 URL。另见:http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    【讨论】:

      猜你喜欢
      • 2013-08-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-16
      • 1970-01-01
      • 2016-11-28
      • 1970-01-01
      • 2013-01-06
      • 1970-01-01
      相关资源
      最近更新 更多