【问题标题】:Url rewrite not working properly in wordpressURL重写在wordpress中无法正常工作
【发布时间】:2014-08-25 19:30:41
【问题描述】:

我已经在 cakephp 的 webroot 文件夹中安装了 wordpress。 现在我的博客可以用“http://smghut.com/blog/”正确打开,但是当我输入“http://smghut.com/blog”(即,没有斜杠(/))时,它最终重定向到“http://www.smghut.com/app/webroot/blog/”。

【问题讨论】:

  • 发布 cakephp .htaccess 文件
  • @machineaddict RewriteEngine On RewriteBase /blog/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L]

标签: php wordpress .htaccess cakephp mod-rewrite


【解决方案1】:

在您的 wordpress 根文件夹中。按以下方式更改 .htaccess。

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /blog/
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /blog/index.php [L]
</IfModule>

【讨论】:

    【解决方案2】:

    您对同一目录的不同规则定义。这是不可能的。最好将您的博客上传到单独的子目录中。 blog.something.com

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-13
      • 1970-01-01
      • 1970-01-01
      • 2023-03-31
      • 2019-04-15
      • 2011-05-15
      • 1970-01-01
      相关资源
      最近更新 更多