【问题标题】:.htaccess Wordpress Symfony.htaccess Wordpress Symfony
【发布时间】:2011-07-18 10:44:18
【问题描述】:

我有一个 Symfony 1.4 项目。使用标准 .htaccess:

Options +FollowSymLinks +ExecCGI

  <IfModule mod_rewrite.c>
  RewriteEngine On

  # uncomment the following line, if you are having trouble
  # getting no_script_name to work
  #RewriteBase /

  # we skip all files with .something
  #RewriteCond %{REQUEST_URI} \..+$
  #RewriteCond %{REQUEST_URI} !\.html$
  #RewriteRule .* - [L]

  # we check if the .html version is here (caching)
  RewriteRule ^$ index.html [QSA]
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

我只想在我的 web symfony 文件夹中有一个 Wordpress 设置(实际上有很多,使用不同的语言):

-web (folder)
 index.php
 frontend.php
 -blogwordpress
  -fr
     index.php
  -en
     index.php

我的问题是:我应该在前面显示的 .htaccess 文件上写什么来允许这样的请求: http://127.0.0.1/blogwordpress/fr

被 Wordpress index.php 赶上,而不是被 Symfony 前端赶上?

当然,当我输入这个 url 时,404 会出现在我的 Symfony 上:

404 | Not Found | sfError404Exception
Action "blogwordpress/fr" does not exist.

提前致谢

【问题讨论】:

    标签: apache wordpress .htaccess symfony1


    【解决方案1】:

    RewriteEngine On 语句之后添加这个;

    RewriteCond %{REQUEST_URI} !^/?wordpress
    

    通俗地说;

    仅当请求wordpress开头时才应用以下规则

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-15
      相关资源
      最近更新 更多