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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:25:18+00:00 2026-05-16T11:25:18+00:00

I have a ZF website at domainA.com and I’d like to alias domainB.com to

  • 0

I have a ZF website at domainA.com and I’d like to alias domainB.com to something like: domainA.com/photos/album so that album would be the root of domainB.

How might this be accomplished?

  • 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-16T11:25:18+00:00Added an answer on May 16, 2026 at 11:25 am

    The first step here is to rewrite the URL to the correct route using mod_rewrite. Something like the following at the top of your exisitng .htaccess root should work:

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{HTTP_HOST}    =domainB.com [NC]
    RewriteCond %{REQUEST_URI} !^/photos/album
    RewriteRule .* /photos/album/$0 [L]
    

    This will redirect to /photos/album/ if no path is specified after domainB.com. If I remember correctly, Zend Framework isn’t picky about whether your controllers/actions are terminated by a slash or not, so this should be fine. If it needs to be /photos/album for some reason, I have a solution for that as well, but it’s overkill if it’s not needed.

    Later, your ruleset translates the URL to index.php, and Zend Framework does its routing. However, the default way Zend Framework does routing is to use REQUEST_URI, which happens to not be what we want in this case (It will be whatever was passed after domainB.com, instead of what we rewrote the request to). We actually need to use REDIRECT_URL, which is set by our new RewriteRule.

    The controller request documentation describes this scenario (kind of), and explains that you can use Zend_Controller_Request_Apache404 as a drop-in request object to obtain the correct route information:

    $request = new Zend_Controller_Request_Apache404();
    $front->setRequest($request);
    

    I’m fairly certain that you could also just get the current request object, and call

    $request->setRequestUri($_SERVER['REDIRECT_URL']);
    

    on it. Just condition this operation on the host, and hopefully it should all work out correctly.

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

Sidebar

Related Questions

I have a website that has images with urls like this: http://mysite.com/image1.jpg My server
I have my website in a subfolder from the main root. www.domain.com ---redirects to--->
I have a problem with my apache. I have test.php on domain.com website that
I'd like to structure my website like this: domain.com/person/edit/1 domain.com/person/edit/2 domain.com/person/edit/3 etc. I have
Hey guys, I have a website that has a url that looks sorta like
hi I have a domain.com website and I was wondering how would I download
I have a website that is working properly.I dont know when I do Domain-name.com/images
I have domain mydomain.com (my website) I have partner link partnerlink.com/something?partnerId (thirdparty provider) Partner
I have a domain set up: www.domain.com, that runs a codeigniter website. I want
I have a website, available through multiple domainnames. like www.domain1.com .... www.domain5.com All my

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.