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 8028587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:10:52+00:00 2026-06-05T00:10:52+00:00

thanks in advance for any help. I have Zend Framework setup for our web

  • 0

thanks in advance for any help.
I have Zend Framework setup for our web app, and has worked fine using a basic SSL redirect until now. We’d like to redirect all URL’s to SSL, except a couple paths. One path works fine and is just loading image files. But the other path does not, and it is a Zend Framework Controller with an Action requiring request arguments.

Here’s our current, working config:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !(/images)
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

The above works for excluding images and allowing ZF to function, but we’d like to also exclude anything in the URI path /wsrv/itemdata
and we tried using this condition:

RewriteCond %{REQUEST_URI} !(/wsrv/itemdata)

/wsrv/itemdata may include several parameters in this format:

/wsrv/itemdata/item_nbr/111111/some_other_arg/a-value

Our problem is that it always redirects to /index.php, which is directed to SSL. We need the redirect to index.php for the framework to function, but not using ssl for only the single controller and action /wsrv/itemdata.

I appreciate any help. Thanks!

EDIT 6-4-12: (SOLVED! mostly)
Its not the URL rewriting, its something in my loader for Zend Framework. I added the rules below and used some test files, the rules work. But something in my framework setup is redirecting it.

RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !(/images/)
RewriteCond %{REQUEST_URI} !(/wsrv/itemdata/)
RewriteCond %{REQUEST_URI} !(/test/make/)
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

The above works, except for the /wsrv/itemdata line, which is going through the framework.

  • 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-06-05T00:10:54+00:00Added an answer on June 5, 2026 at 12:10 am

    I found a solution to my problem.
    This Question posted by another user helped and was related, but I couldn’t get his solution to work:

    htaccess https redirect only on specific Zend Frameworks controller/actions

    My solution worked, except one issue, which didn’t prevent me from moving forward. The rewrite rules listed below allow me to omit SSL connection under specific Zend Framework controller and action methods, while forcing anything else not existing to use normal SSL connections. (basically, force everything SSL, but one path)

    The only exception to this solution was the trailing “/” in the URL sent. If I do not send in the trailing slash, it will still auto-forward me to index.php. Since I need arguments passed in anyway, the trailing slash is there, so works for me.
    Works: /wsrv/itemdata/
    Works: /wsrv/itemdata/item_nbr/123456/otherarg/otherval
    Not work: /wsrv/itemdata

    Here’s the final, complicated rewrite rules:

        RewriteEngine On
    
    #if req is normal file, dir
    #then pass in request unchanged (show css, js, img, etc, no ZF)
    #do not proc more rules
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    
    #if req is ssl
    #   and not wsrv/itemdata
    #   and not images
    #   and not test/make
    # then rewrite req to index.php to use ZF
    #do not proc more rules
    RewriteCond %{HTTPS} on
    RewriteCond %{REQUEST_URI} !wsrv/itemdata/
    RewriteCond %{REQUEST_URI} !images/ 
    RewriteCond %{REQUEST_URI} !test/make/ 
    RewriteRule ^.*$ index.php [L]
    
    #NOTE: itemdata/ must have trailing / in client requsts
    # In other words, requesting /wsrv/itemdata will redirect to index
    # I don't know how to fix that yet
    # But / is always used anyway because request args are used
    # Ex: /wsrv/itemdata/item_nbr/12345678
    
    #if req is NOT ssl
    #   and we want wsrv/itemdata/
    #then rewrite without ssl to ZF index.php
    #do not proc more rules
    RewriteCond %{HTTPS} !=on
    RewriteCond %{REQUEST_URI} wsrv/itemdata/
    RewriteRule ^.*$ index.php [L]
    
    # Last if none above match, check for non-ssl
    #if req is ssl
    #   and not wsrv/itemdata
    #   and not images
    #   and not test/make
    # then REDIRECT to https:// using same URI
    #do not proc more rules
    RewriteCond %{HTTPS} !=on
    RewriteCond %{REQUEST_URI} !wsrv/itemdata/
    RewriteCond %{REQUEST_URI} !images/ 
    RewriteCond %{REQUEST_URI} !test/make/ 
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using c# .net. Thanks in advance for any help. I have searched
Thanks in advance for any help. I have the following code which when clicked
Hi thanks in advance for any help. I have two images of a coin
Thanks in advance for any help you can provide! I have a website built
Thanks in advance for any help. This has me confused as I've used the
Thanks for any help in advance. So, I'm storing songs in a filesystem with
Thanks for any help in advance, I can't wrap my SQL skills around this
Hey guys, thanks in advance for any help or input. I am having trouble
Thanks in advance for any help... I'm trying to (1) generate a begin time
Thanks in advance for any-help with this, I'll try and explain it well. I

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.