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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:55:24+00:00 2026-05-28T20:55:24+00:00

Iv seen load of htaccess examples and generators to rewrite a url, however I

  • 0

Iv seen load of htaccess examples and generators to rewrite a url, however I need to put in a 301 redirect for a web app which used to be on a subdomain, but is now in a directory, its also moved from .asp tp .php

the basic redirect is

http://sub.domain.com/twforum/forum.asp?FORUM_ID= 

redirects to

http://domain.com/forum/viewforum.php?f=

this part i can do, but i dont know how to handle the id (forum id) that will be passed in the url, I DONT want the forum id to be rewritten to a url friendly on, just for it to be carried over/redirected

I assume i need to mod_rewrite the query part.

heres what iv got

RewriteEngine On
RewriteCond %{QUERY_STRING} ^http://sub.domain.com/twforum/forum.asp?FORUM_ID=1$ [NC]
RewriteRule http://domain.com/forum/viewforum.php\?f=1$ [L,R=301]

can anyone see any clear errors there or know of a better way?

thanks

  • 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-28T20:55:26+00:00Added an answer on May 28, 2026 at 8:55 pm

    %{QUERY_STRING} does not contain the whole of the URL. Just the query setting part. e.g. FORUM_ID=1

    Assuming that your fourum ids re just numerals.

    RewriteEngine On
    RewriteCond %{QUERY_STRING} FORUM_ID=(\d+)$ [NC]
    RewriteRule ^ http://domain.com/forum/viewforum.php\?f=%1$ [L,R=301]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've seen examples for load() and ready() , but they always seem to apply
I need to load jQuery1.7 as module, I've seen this code of @jrburke :
I have seen websites which load a index.html page containing the header, footer etc,
Seen various examples of WPF applications I've seen the use of the Grid control
I have seen many apps that load data to UITableViews from the internet, and
Hi I want to load a square image (the page curl) as seen in
Has anyone seen any how-to, documentation, or otherwise about how to load HTTP Modules
I have seen a couple similar questions about this, however none of them work
I have seen some websites load static data on a page first, and in
Has anyone ever seen this odd error when attempting to load an applet? 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.