Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6590677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:19:49+00:00 2026-05-25T17:19:49+00:00

I have a Zend Framework site in this dir /var/www/example.com/ and put the WP

  • 0

I have a Zend Framework site in this dir /var/www/example.com/ and put the WP blog in this dir /var/www/example.com/public/blog/

The following are the important files…

/var/www/example.com/public/.htaccess contains:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^blog - [NC,L] #Just added this line, it was previous not there
RewriteRule ^.*$ index.php [NC,L]

Then my .htaccess in the /blog/ folder is this:

# BEGIN WordPress
<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>
# END WordPress

Clicking around the zend site works fine. Going into the /blog/ subfolder loads the WP blog just fine. But when I click on any post in the blog, it gets redirected to the ZF app, and doesn’t stay within wordpress.

The end result I am chasing is to keep the two separate, yet make sure both of them rewrite the index.php so it isn’t rendered in the URL.

I don’t have good experience with htaccess so I am not sure what’s happening. Here is my VHost just for good measure.

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "/var/www/example.com/public"
ServerName example.com
ErrorLog "logs/example.local-error.log"
CustomLog "logs/example.local-access.log" common

<Directory "/var/www/example.com/public" >
         Options Indexes FollowSymLinks
         AllowOverride All
         Order allow,deny
         allow from all

</Directory>

<Location />
        RewriteEngine on
        RewriteBase /
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php
</Location>

SetEnv APPLICATION_ENV development

</VirtualHost>

NOTE I removed the .htaccess in the /public/ folder for testing because of the Rewrite rule in the VHost, but my problem remains.

The request & response URLs are the same as they are shown in the browser:

http://example.local/blog/my-test-blog-post/

HOWEVER, the browser renders an error from ZF, indicating it was directed to the public/index.php file instead of the intended public/blog/index.php file. I also used Netbeans & XDebug to step through the code. I put a breakpoint on the first line of both index.php files, and when clicking a blog post link, it immediately loads the ZF index.php, not the /blog/index.php

It appears if I use a URL like http://example.local/blog/?p=695 it works and is not routed to the ZF app. but when I use custom permalinks in wp-admin like http://example.local/blog/my-test-blog-post/ it tries to route to ZF.

From looking around google, it tells me the htaccess in the /blog/ folder is incorrect. Options FollowSymLinks & AllowOverride All are both set. I just can’t get it right…
http://wordpress.org/support/topic/custom-permalinks-not-working-1

I will also add that mod_rewrite IS working because I can click through the ZF app just fine.

As a final note, this permalink works on WP:

/index.php/%post_id%/%postname%/

But I want to use this without the index file:
/%post_id%/%postname%/

mod_rewrite log:

1(2) init rewrite engine with requested uri /blog/698/test-blog-post/
(1) pass through /blog/698/test-blog-post/
(3) [perdir /] add path info postfix: D:/www/example/public/blog/698 -> D:/www/example/public/blog/698/test-blog-post/
(3) [perdir /] applying pattern '\.(js|ico|gif|jpg|png|css)$' to uri 'D:/www/example/public/blog/698/test-blog-post/'
(4) [perdir /] RewriteCond: input='D:/www/example/public/blog/698' pattern='!-f' => matched
(4) [perdir /] RewriteCond: input='D:/www/example/public/blog/698' pattern='!-d' => matched
(2) [perdir /] rewrite 'D:/www/example/public/blog/698/test-blog-post/' -> '/index.php'
(2) [perdir /] trying to replace prefix / with /
(5) strip matching prefix: /index.php -> index.php
(4) add subst prefix: index.php -> /index.php
(1) [perdir /] internal redirect with /index.php [INTERNAL REDIRECT]
(2) init rewrite engine with requested uri /index.php
(1) pass through /index.php
(3) [perdir /] applying pattern '\.(js|ico|gif|jpg|png|css)$' to uri 'D:/www/example/public/index.php'
(4) [perdir /] RewriteCond: input='D:/www/example/public/index.php' pattern='!-f' => not-matched
(1) [perdir /] pass through D:/www/example/public/index.php

Another mod_rewrite log After trying Jason Dean’s suggestion (didn’t work)

(2) init rewrite engine with requested uri /blog/698/test-blog-post/
(1) pass through /blog/698/test-blog-post/
(3) [perdir /] add path info postfix: D:/www/example/public/blog/698 ->  D:/www/example/public/blog/698/test-blog-post/
(3) [perdir /] applying pattern '\.(js|ico|gif|jpg|png|css)$' to uri 'D:/www/example/public/blog/698/test-blog-post/'
(4) [perdir /] RewriteCond: input='D:/www/example/public/blog/698' pattern='!-f' => matched
(4) [perdir /] RewriteCond: input='D:/www/example/public/blog/698' pattern='!-d' => matched
(2) [perdir /] rewrite 'D:/www/example/public/blog/698/test-blog-post/' -> '/index.php'
(2) [perdir /] trying to replace prefix / with /
(5) strip matching prefix: /index.php -> index.php
(4) add subst prefix: index.php -> /index.php
(1) [perdir /] internal redirect with /index.php [INTERNAL REDIRECT]
(2) init rewrite engine with requested uri /index.php
(1) pass through /index.php
(3) [perdir /] applying pattern '\.(js|ico|gif|jpg|png|css)$' to uri 'D:/www/example/public/index.php'
(4) [perdir /] RewriteCond: input='D:/www/example/public/index.php' pattern='!-f' => not-matched
(1) [perdir /] pass through D:/www/example/public/index.php
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:19:49+00:00Added an answer on May 25, 2026 at 5:19 pm

    Try adding:

    RewriteCond %{REQUEST_URI} !^/blog
    

    To your first .htaccess

    I think that it is intercepting any requests to your blog subfolder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP5/Zend Framework 1.8.1 web site which is located at: http://www.example.com/foo The
I have my website in /var/www/invent. I have zend-framework in /var/www/invent/library. Basically what i
The Zend Framework based site I have been working on is now being migrated
We have a site built in Zend Framework and we're using the Zend Soap
I have one module (site) in my zend framework app. What I am trying
I have this code to create a config.ini file with Zend Framework but I
Good day to all. I have a site (created with zend framework and smarty)
I am developing a web site using the Zend Framework. I was using this
I have make one site using Zend Framework. Its working fine in development server
I have a Zend Framework application structure as below: /application /library /Zend /Core /Filter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.