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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:43:59+00:00 2026-06-04T04:43:59+00:00

i am a noob in htaccess so i want some help please ! i

  • 0

i am a noob in htaccess so i want some help please !
i want to deny access to a js file if it is opened ftom the url bar ex ( when i type http://mysite.com/js/jquery.js in the address bar – i get a 403 ) but when the site is rendered by the browser it is downloaded to the browser normally .

for the moment i was trying this

   <Files ~ "(.js|.css)">
    Order allow,deny
    deny from all
    </Files>

but this prevents the browser to use the css and the js so i want to make a kind of rule to let the browser but not anyone directly from the url . can in this case use the referer or the host or something like this ?

(note : i don’t want to prevent the clients from viewing the js code because they could do it anyway but i have my reasons)

  • 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-06-04T04:44:01+00:00Added an answer on June 4, 2026 at 4:44 am

    This would be the same as preventing image hotlinking. See http://altlab.com/htaccess_tutorial.html.

    i.e:

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
    RewriteRule .*\.(js|css)$ - [F]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to URL rewriting and I have an .htaccess file that looks
I am a complete noob when it comes to the .htaccess file... What I'm
noob when it comes to .htaccess . I need a mod_rewrite of a URL.
Noob help please. I'm trying to write a script that will check if a
noob Android/JSON person here. I hope someone might help me? I've looked and looked
I'm a .htaccess nOOb, but I think this is the best way to do
Noob question here. Please see code below. Where can I read more on this?
Noob to Subversion, so please bear with me. Is there a way to get
Emacs noob here, For some reason, when I try to Open a existing C++
Okay, I'm a complete noob when it comes to editing .htaccess. I've never messed

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.