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

The Archive Base Latest Questions

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

I want to make Friendly URLs, but when I try my PHP code works

  • 0

I want to make Friendly URLs, but when I try my PHP code works correctly but my CSS and JS files are not loaded correctly. It tries to get these files from different path.
I’m using WAMP, and I’ve created bsp directory for my project.
There are two folders for js and css files and I’ve used the css and js files in my php pages like

< script type="text/javascript" src="js/menu_config.js">< / script >
< link rel="stylesheet" type="text/css" href="css/menu.css" / >

and the .htaccess file code is here:

RewriteEngine On
RewriteRule ^products/([0-9]+)_([0-9]+).html$   products.php?maid=$1-$2 [L]

But when I browse through url http://localhost/bsp/products/2_7.html,

It does not load the js and css files.. at that time the path of js and css files becomes
http://localhost/bsp/products/css/menu.css etc
the css and js path should be http://localhost/bsp/css/menu.css.

I hope anybody will understand this problem as soon as possible.

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

    This is just to do with your paths when including the files. You’re currently using relative links, which means that “js/menu_config.js” will be appended onto the current URL.

    Instead, you need an absolute path. By prepending your URLs with a /, you denote that you want to specify the path relative to the document root (rather than the current subdirectory). I’ll leave out what the paths should be for now, filling them in is an exercise for you.

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

Sidebar

Related Questions

I want to make an entity that has an autogenerated primary key, but also
I want to make sure people can't type the name of a PHP script
I'm trying to make the URLs of my site SEO and user friendly. It
As titled, I want to make my application more user friendly by moving the
I use a .htaccess file to rewrite my urls to make them SEO friendly,
I'm developing a website and in my attempt to make friendly URLs without recurring
I want to make my pages search engine friendly and it also looks better
I have complex form that I want to make more user friendly. It consists
I want make datetimepicker in my project. Using jquery how it is possible? I
Let's say I want make some of my sources publicly available via my blog

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.