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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:42:09+00:00 2026-05-26T22:42:09+00:00

Bit of additional info… PHPBB has a way to redirect you after login to

  • 0

Bit of additional info…

PHPBB has a way to redirect you after login to the page you were looking at before, even if you’re using the login-form externally on your own pages. However they decided it should be a relative path within your own domain. Which is not exactly great if you have the forum on a subdomain like forum.mydomain.com…

The example from their wiki: <input type="hidden" name="redirect" value="./somefile.html" />

To work around the problem of the subdomain, I figured I would add an indication of a frontpage redirect to it, like <input type="hidden" name="redirect" value="./redirect/frontpagenews.php" />

So if you use the login-form on the page http://mysite.com/frontpagenews.php the forum redirect url ends up looking like forum.mysite.com/redirect/frontpagenews.php (this works, the forum creates this link to go back to after login). All it needs is a rewrite rule to detect this so it would actually sent you back to http://mysite.com/frontpagenews.php

The question…

How do I go from forum.mysite.com/redirect/*anything* to mysite.com/*anything* ?

I’ve been at this for a while now, and I think the code below should work, except it doesn’t. I’ve put it above the other forum rewrite rules in the htaccess file in forum.mysite.com as it probably should be fine if it’s the first rule that’s checked.

RewriteCond %{HTTP_HOST} ^forum\.mysite\.com/redirect/(.*)$ [NC]
RewriteRule (.*) http://mysite\.com/$1 [QSA,L,NC]

Also tried this as condition, but no joy:

RewriteCond %{REQUEST_URI} /redirect/(.*)$ [NC]
  • 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-26T22:42:10+00:00Added an answer on May 26, 2026 at 10:42 pm

    The HTTP_HOST only matches against a hostname, not the path. The path needs to be part of the RewriteRule. Assuming that the .htaccess file that you are editing resides in the forum.mysite.com root (as in the equivalent of: forum.mysite.com/.htaccess), it should look like this:

    RewriteCond %{HTTP_HOST} ^forum\.mysite\.com$ [NC]
    RewriteRule ^redirect/(.+)$ http://mysite.com/$1 [L,NC,R]
    

    You won’t need the QSA in the rule brackets because the query string will get appended anyways (unless you have a ? in the target, e.g. http://mysite.com/$1?p=1).

    This will redirect the browser from forum.mysite.com/redirect/*anything* to mysite.com/*anything*

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

Sidebar

Related Questions

Bit of an odd question but is there a way of seeing what objects
Is this is a 32-bit or 64-bit JVM? # A fatal error has been
I am a bit new to linq, I am only using linq for filtering
So the Play2.0 Enumeratee page shows an example of using a the &> or
I have some flexibility here so I'm looking for some advice before I lock
Bit of a puzzle for you.... I have a 730px wide, auto height div.
Bit of an unusual question, but I have setup a field inside a MySQL
Bit of a tough one to explain here, but I'll do my best. I
Bit of a javascript newbie so not sure if this question is easy or
Bit of a weird glitch here. The tag name of a childNode is logged

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.