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

  • Home
  • SEARCH
  • 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 8832223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:28:48+00:00 2026-06-14T08:28:48+00:00

Situation I’m using Zend framework, and thus attempt to call the folder by address

  • 0

Situation

I’m using Zend framework, and thus attempt to call the folder by address ends in a fiasco and we gets the error: ‘Invalid controller specified’. I needed to hook up additional forum to application in a separate folder. I change .htaccess file as follow:

RewriteRule ^forum(.*)$ forum$1 [L]

and for a while it was good, until I realized the fact that the page exists in two versions in two domains (php recognizes domain [.pl/.co.uk] and selects the language). So I decided to separate forums as a two separate modules (for example, the folder for Polish version forum will be: forum_pl, and for UK it will be: forum_uk – two different forums)

What’s the problem?

It needs to rewrite .htaccess file to work like this:

IF: http://www.domena.pl/forum

THEN: open to the script from the folder /forum_pl

IF: http://www.domain.co.uk/forum

THEN: open to the script from the folder /forum_uk.

The worst thing is that when I tried to fix .htaccess file adding RewriteCond then the first redirect no longer work correctly, even after returning to the original (shown above) version.

Please help me and sorry if I did not find answers already given earlier.

EDIT:

First working solution

RewriteRule ^forum_pl(.*)$ forum_pl$1 [L]
RewriteRule ^forum_uk(.*)$ forum_uk$1 [L]
RewriteCond %{HTTP_HOST} ^www.domena.pl(.*) [NC]
RewriteRule ^forum(.*)$ forum_pl$1 [L]
RewriteCond %{HTTP_HOST} ^www.domain.co.uk(.*) [NC]
RewriteRule ^forum(.*)$ forum_uk$1 [L]

It’s look like it wants to work but, problems that needs solution is (TODO):

  1. When you type: http://www.domain.pl/forum it gets you to http://www.domain.pl/forum_pl/ but if you type: http://www.domain.pl/forum/ it gets you to http://www.domain.pl/forum/ (read from forum_pl). How to make that it works in first situation same, as in second.

EDIT:

My last solution:

#FORUM
#PL
RewriteCond %{REQUEST_URI} ^/forum$ [NC]
RewriteRule ^(.*)$ forum/ [R=301,L]

RewriteRule ^forum_pl(.*)$ forum_pl$1 [L]

RewriteCond %{REQUEST_URI} ^/forum_pl(.*)$ [NC]
RewriteRule ^(.*)$ http://www.domena.pl/forum/ [R=301,L] #Dosen't work properly (?)

RewriteCond %{HTTP_HOST} ^www.domena.pl(.*) [NC]
RewriteCond %{REQUEST_URI} ^/forum(/?)$ [NC]
RewriteRule ^forum[^/](.*)$ forum_pl/$1 #Dosen't work properly, but without it crash!
RewriteRule ^forum(.*)$ forum_pl$1 [L]
#UK
RewriteCond %{REQUEST_URI} ^/forum_uk(.*)$ [NC]
RewriteRule ^(.*)$ http://www.domain.co.uk/forum/ [R=301,L] #Dosen't work properly (?)

RewriteCond %{HTTP_HOST} ^www.domain.co.uk(.*) [NC]
RewriteCond %{REQUEST_URI} ^/forum(/?)$ [NC]
RewriteRule ^forum[^/](.*)$ forum_uk/$1 #Dosen't work properly, but without it crash!
RewriteRule ^forum(.*)$ forum_uk$1 [L]

Final, working version:

RewriteRule ^forum_pl(.*)$ forum_pl$1 [L]
RewriteRule ^forum_uk(.*)$ forum_uk$1 [L]

RewriteRule ^forum_pl(.*)$ http://www.domena.pl/forum$1 [R=301,L] # Not working!
RewriteRule ^forum_uk(.*)$ http://www.domain.co.uk/forum$1 [R=301,L] # Not working!

# Normalize URL first:
RewriteRule ^forum$ forum/ [R=301,L]

# redirect to polish version of web under forum_pl if on .pl TLD and
#  request is made to /forum/ (already normalized)
RewriteCond %{HTTP_HOST} =www.domena.pl [NC]
RewriteRule ^forum(.*)$ forum_pl$1 [L]

# redirect to english version of web under forum_en in on .uk TLD and
#  request is made to /forum/
RewriteCond %{HTTP_HOST} =www.domain.co.uk [NC]
RewriteRule ^forum(.*)$ forum_uk$1 [L]

It is a pity that you can call from your browser forum_uk and forum_pl folders manually.

  • 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-14T08:28:49+00:00Added an answer on June 14, 2026 at 8:28 am

    Not sure if I oriented correctly in your long question with some evolution 🙂
    Lets try this:

    # Normalize URL first:
    RewriteRule ^forum$ forum/ [R=301,L]
    
    # redirect to polish version of web under forum_pl if on .pl TLD and
    #  request is made to /forum/ (already normalized)
    RewriteCond %{HTTP_HOST} =www.domena.pl [NC]
    RewriteRule ^forum/(.*)$ http://www.domena.pl/forum_pl/$1 [R=301,L]
    
    # redirect to english version of web under forum_en in on .uk TLD and
    #  request is made to /forum/
    RewriteCond %{HTTP_HOST} =www.domain.co.uk [NC]
    RewriteRule ^forum/(.*)$ http://www.domain.co.uk/forum_uk/$1 [R=301,L]
    

    If you need the rewites to act differently, let me know

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

Sidebar

Related Questions

Situation: I am imaging new systems using MDT Lite-Touch. I am trying to customize
Situation: Generating N samples of a shape and corresponding edges (using Sobel filter or
Situation: I'm using both OpenFeint/Game Center in a cocos2d game. OpenFeint has a 'dashboard'
Situation: I am trying to write a efficient query using "LIKE" statement to look
Situation is that level of log4net is configured as 'Error' but there is some
Situation: When quitting a main activity of an android app, I wish to call
Situation: (Large) PDFs are stored on an iOS device The PDFs are encrypted using
Situation: multiple front-ends (e.g. Silverlight, ASP) sharing a single back-end server (WCF RIA or
Situation: I have a UserControl (call it UCA) with it's DataContext bound to a
Situation is simple: I post a plain HTML form with a textarea. Then, in

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.