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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:09:40+00:00 2026-05-20T12:09:40+00:00

I use this Javascript code to mark threads as favourite: function fave(tid){ xmlhttp =

  • 0

I use this Javascript code to mark threads as favourite:

function fave(tid){
 xmlhttp = createXHR();
 if(xmlhttp){
  xmlhttp.onreadystatechange = function(){
   if(xmlhttp.readyState == 4 && xmlhttp.status == 200){
    get("fave"+tid).innerHTML = xmlhttp.responseText;
   }
  }
  xmlhttp.open("GET", "thread?act=fave&tid="+tid+"&ajax=1", true);
  xmlhttp.send(null);
 }
}

My .htaccess file contains this line RewriteRule ^thread/([0-9]+)? /thread?tid=$1 [L], which turns /thread?tid=1234 in more pretty /thread/1234.

With the first URL everything works fine, but /thread/1234 causes an error.
enter image description here
Click on the underlined link returns:
enter image description here

Response HTML is a copy of a whole page!
Why the same document with the only difference between /thread?tid=1234 and /thread/1234 URLs behaves in different ways?

UPDATE:

RewriteRule ^thread/([0-9]+)? /thread?tid=$1 [L,QSA]

The improved .htaccess line solved the problem.

  • 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-20T12:09:41+00:00Added an answer on May 20, 2026 at 12:09 pm

    Try using the [QSA] modifier in your htaccess.

    At the first look, your problem is that the ajax=1 and act=fave values do not get appended after rewriting the URL.

    So the RewriteRule should be:

    RewriteRule ^thread/([0-9]+)? /thread?tid=$1 [L,QSA]
    

    And then your code:

    xmlhttp.open("GET", "thread/"+tid+"?ajax=1&act=fave", true);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've seen a few JavaScript code examples that use this sort of syntax: function(foo:String)
When I select an element by name in Javascript, I usually use this code:
I am working with session timeout in javascript. I use this code for the
I use this simple Javascript code to retrieve text that was selected on a
I use this javascript to edit text in place: http://josephscott.org/code/javascript/jquery-edit-in-place now I need to
I'm trying to convert this Javascript code: self.userSerialEvent = function (join, value, tokens) {
I use this JavaScript code inside the head tag in order to populate the
Over 1 hour on this. This is javascript code inside my index.php file. function
how can i use this javascript code on a webpage, who is inside an
I have an issue with Mozilla, i use this client side JavaScript code 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.