如何 运行 zf2 与 wordpress..?
How to run zf2 with wordpress..?
我已经用 wordpress 安装了 zf2。现在 wordpress 工作正常但是当我尝试访问 puclic/index.php 它显示内部服务器错误。下面是我在 public 文件夹中的 .htaccess:
RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# The following rewrites all other queries to index.php. The
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size
# fits all solution.
RewriteCond %{REQUEST_URI}:: ^(/.+)(.+)::$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 600
php_value max_input_time 600
任何帮助将不胜感激。
您可以将所有 wordpress 文件移动到特定文件夹,就像我在我的页面文件夹中所做的那样,并更新 ZF2 基本 htaccess,如下所示:
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteRule ^$ http://example.com/pages [R=301,L]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /public/index.php [NC,L]
我已经用 wordpress 安装了 zf2。现在 wordpress 工作正常但是当我尝试访问 puclic/index.php 它显示内部服务器错误。下面是我在 public 文件夹中的 .htaccess:
RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# The following rewrites all other queries to index.php. The
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size
# fits all solution.
RewriteCond %{REQUEST_URI}:: ^(/.+)(.+)::$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 600
php_value max_input_time 600
任何帮助将不胜感激。
您可以将所有 wordpress 文件移动到特定文件夹,就像我在我的页面文件夹中所做的那样,并更新 ZF2 基本 htaccess,如下所示:
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteRule ^$ http://example.com/pages [R=301,L]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /public/index.php [NC,L]