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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:14:01+00:00 2026-05-28T13:14:01+00:00

I’m using the .htaccess file to make my URLs SEO friendly, but when I

  • 0

I’m using the .htaccess file to make my URLs SEO friendly, but when I add a folder in URL the CSS and Javascript stops loading.

If I use this url it works (where id=”123″ and str=”some-package-name”):
http://www.mysite.com/package123_some-package-name

RewriteRule package(.*)_(.*)$ packages.php?id=$1&str=$2

But if I use this URL, it doesn’t (where id=”123″ and str=”some-package-name”):
http://www.mysite.com/package123/some-package-name

RewriteRule package(.*)/(.*)$ packages.php?id=$1&str=$2

I’d prefer to use the directory-based URL if possible.

Also, is there any way to submit a form through .htaccess via the POST method to any other file?

Can anyone help please…thanks in advance!

  • 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-28T13:14:02+00:00Added an answer on May 28, 2026 at 1:14 pm

    You prefer to use use directory based url. Thats ok.

    The problem is you are most likely using relative url-s for the css. Try to use domain relative or absolute url-s to css.

    The reference for the css is probably relative in your header, so pointing to “style/asdf.css” results in “http://www.mysite.com/style/asdf.css” the first time, and “http://www.mysite.com/package123/style/asdf.css” the second time, as the browser searches for the css relative to the location of the current document. And the browser thinks that is’s in a folder.

    Use absolute or domain-relative urls for the css.

    Absolute, starting with a protocol like http:// (good):

    <­link rel="stylesheet" type="text/css" href="http://www.mysite.com/style/asdf.css">
    

    Domain-relative, starting with / (good):

    <­link rel="stylesheet" type="text/css" href="/style/asdf.css">
    

    Relative, starting with something else (in most cases bad):

    <­link rel="stylesheet" type="text/css" href="style/asdf.css">
    

    This is also true for javascripts.

    EDIT: Since I have checked your site, I have seen that every url suffers from this problem there. Try to click “Single user package” for a few times and see what it does to the url. That is the problem with relative urls. When you are using relative urls, the same url used form different folders points to different places.

    If you are planning to use virtual folders in mod rewrite you must not use relative urls.

    That means that lines like these will result in errors:

    <li><a href="package3/night-delight">Night delight</a></li>
    

    and

    <li><a href="book-your-demo">Book your demo</a></li>
    

    or

    <script type="text/javascript" src="js/validations-compressed.js"></script>
    

    or

    <li class="slct"><a href="index">Home</a></li>
    

    also

    <a href="index.php" id="logo" title="CGBroadband.com">
    <link rel="icon" type="image/png" href="images/template/fav.png" />
    

    these will point elswhere from every page. So it’s not just a css problem, it’s a problem with every single link on the page.

    In your case the easiest solution would be putting a / before all your urls.

    Edit: Also check out this: I have found an other working solution that might be even easier: https://developer.mozilla.org/en/HTML/Element/base

    That means if you put

    <base href="http://www.mysite.com/" />
    

    in your <­head>, then all the relative urls will be relative to that! Neat isn’t it? But I have heard someone complain about IE compatibility on this one so check it out on all browsers.

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

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have just tried to save a simple *.rtf file with some websites and
I used javascript for loading a picture on my website depending on which small

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.