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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:10:28+00:00 2026-05-26T19:10:28+00:00

I have to use <base href=http://www.mysite.com/it//> on my site because I am using apache

  • 0

I have to use <base href="http://www.mysite.com/it/"/> on my site because I am using apache mod_rewrite, that causes issues if I do not put the base href tag.

But the problem is now coming with this jQuery function:

$(document).ready(function(){
    $("#submit_newsletter").click(function(){                                      
        var hasError = false;
        var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;

            var nameVal = $("#name").val();
        if(nameVal == '') {
                        $("#name").addClass("highlightError").delay(4000).queue(function(){
        $(this).removeClass("highlightError");
        $(this).dequeue();
    });
        hasError = true;
                 }

               var subnameVal = $("#subname").val();
        if(subnameVal == '') {
                        $("#subname").addClass("highlightError").delay(4000).queue(function(){
        $(this).removeClass("highlightError");
        $(this).dequeue();
    });
            hasError = true;
        }


        var emailVal = $("#email").val();
        if(emailVal == '') {
            $("#email").addClass("highlightError").delay(4000).queue(function(){
        $(this).removeClass("highlightError");
        $(this).dequeue();
    });

   hasError = true;
        } else if(!emailReg.test(emailVal)) {
                        $("#email").addClass("highlightError").delay(4000).queue(function(){
        $(this).removeClass("highlightError");
        $(this).dequeue();
    });
        hasError = true;
        }


        var messageVal = $("#message").val();
        if(messageVal == '') {
                        $("#message").addClass("highlightError").delay(4000).queue(function(){
        $(this).removeClass("highlightError");
        $(this).dequeue();
    });

            hasError = true;
        }



        if(hasError == false) {
            $.post("mail.php",
                { name: nameVal, subname: subnameVal, email: emailVal, message: messageVal },
                    function(data){
                        $("#results").text("Messaggio Inviato.").delay(4000).queue(function(){
       $("#results").text("")
        $(this).dequeue();
    });

                                                $('#newsletter')[0].reset();

                    }
                 );
        }

        return false;
    });     

});

When I remove the base href tag it works just fine, when I use it ( and I repeat, I must use it ) the above jQuery function stops to work.
It does not give any error, simply it does not pass any value to the mail.php file, and does not return any result.

How can I fix this jQuery issue with the base href tag?

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-26T19:10:29+00:00Added an answer on May 26, 2026 at 7:10 pm

    I think you are not rewriting your querystring in the rewrite. The url will be something like this now, since jQuery $.post default type is the GET method:

    mysiste.com/it/?param1=value1 
    

    You can use the type : “post” in jQuery to not use the querystring.

    The RewriteRule if you want to keep your GET method should be something like this:

    RewriteRule ^/it/$ /mail.php [QSA,L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have many projects that use a common base of shared components (dlls). Currently
I have a code base that makes extensive use of files to represent a
Is it possible to use the using declaration with template base classes? I have
I have a site where I use the base tag. All the links in
I have the following code in my website: <link rel=apple-touch-icon href=http://website.com/images/apple-touch-icon.png /> When I
I have use include ('base.php') script in my other scripts ( more.php ). Now
I have a base class like this: package MyClass; use vars qw/$ME list of
Does anyone use have a good regex library that they like to use? Most
I have developed a simple site that fetches tweets from the Twitter public timeline,
I have a class that extends a base class. The base class is more

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.