Htaccess Files..

Jul 20, 2007

I have a directory on my web server that should not be accessible by default, the files in here are being included by php files outside the directory.. so quite simply, I need to protect the directory.

Now I don't want to protect it with a login, that's simply not needed, the directory and all the files in it should simply be inaccessible..

I don't know a whole lot about htaccess though, can anyone here tell me what to put in the .htaccess files to simply deny all access to the directory and if possible display a specific error message.

View 2 Replies


ADVERTISEMENT

Apache :: Using Alias With HTAccess Files

Feb 20, 2013

Apache httpd Users mailing list, but nobody there has responded in several days. I'm using mod_alias to map URLs to directories that are outside of Apache's DocumentRoot. However, it seems that .htaccess files are being ignored in these directories.

View 6 Replies View Related

Use .htaccess File To Allow Access To Zip Files Only From My Script

Feb 18, 2007

I have download manager script that I use for my customers to download products right after the purchase.

Script generates download link that looks like this:

http://www.yourwebsite.com/download/...582921B&p=1840 (where 2YY6582921B is receipt number that is different with each purchase).

All products are placed in one folder. This folder can not be seen in above download url, but can be accessed thru browser and files can be downloaded that way without paying for them.

Can I use .htaccess and if yes how, to protect all product files the way that they can not be accessed directly by visiting url thru browser (in case somebody will find the correct url), they should be allowed for access only for my download manager script.

View 3 Replies View Related

Wierd Htaccess Url Rewrite- Rewrites All Index Files

Apr 19, 2008

I have worked with mod_rewrite for years and never encountered this problem. I am converting html pages to a single php file and it works perfectly. I used htaccess the rewrite the urls to appear the same so that no links would be broken or lose SEO value.

The only problem is that my friend who also helped build the sites added different directories and within those directories are index.htm files that serve as a home page for the separate directory. Like /info/index.htm and /help/index.htm within the root directory. The problem is that for some reason my mod_rewrite directs to the main index.htm rewrite even if I include the whole path to the file. In htaccess I have this so far:

RewriteEngine on

RewriteRule index.htm$ index.php [L]
RewriteRule servers.htm$ index.php?action=servers [L]
RewriteRule movies.htm$ index.php?action=movies [L]
However there is a directory named "info" and inside that directory it has an index.htm file and it seems to conflict with my first mod_rewrite. I tried using:

RewriteRule /info/index.htm$ index.php?action=info [L]
and used other methods but none seem to work any ideas?

View 1 Replies View Related

Transferring 200 Files : Total Files Size Is 25 GB!

Jan 2, 2008

I couldn't keep my mouth shut (technically fingers). A customer wanted to upgrade servers and he needed a way to move the data across. Since I don't allow hard drives to be swapped, they have to do it manually all by themselves. I generally allow up-to 4 days for them to transfer data and make DNS changes, etc. But this time, I offered help! I agreed to move the data (darn me) and it just came out of me, involuntarily.

God knows what just happened... but in a positive way, customer is extremely happy!

So...

Both servers are on cPanel - with root access (duh)

200 odd files which total to 25 GB

1 database about 100 MB in size (no biggie)

I was planning on using one of my Windows 2003 servers (via remote desktop) to download the 25 GB and upload the 25 GB, but that sounds like a waste of resources and time.

View 8 Replies View Related

.htaccess On IIS

Jun 3, 2008

I am using a script, on which i want to enable friendly URL, below are the instructions.

Friendly URLs Settings
Apache Settings

(please add the following lines to your
.htaccess file to turn on friendly URLs)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /hcl/friendly_url.php [L]
</IfModule>

But, issue is, i am using IIS on Windows Server.

How can i implement this?

View 11 Replies View Related

Com To Co.uk With .htaccess

Sep 7, 2008

I want a rule in .htaccess that will convert all .com addresses into .co.uk ones as I have a .com mapped to the .co.uk address for the site.

View 7 Replies View Related

.htaccess

Mar 11, 2007

I have a vds with godaddy. I uploaded my site and then uploaded .htaccess (AddHandler server-parsed .html) Then when I go to my site in browser I get this error.

Safari can’t open the page “mydomain”. The error was: “lost network connection” (NSURLErrorDomain:-1005) Please choose Report Bug to Apple from the Safari menu, note the error number, and describe what you did before you saw this message.

The thing is, I did the exact same thing on another domain with the same htaccess file and everything works fine. SSI is enabled on both.

View 1 Replies View Related

.htaccess

Oct 11, 2007

I'm currently having a problem with a site of mine. The problem is that trying to go to domain.com/subdirectory/ (with or without the trailing slash) gets a 404 error (even though the directory exists).

However, domain.com/subdirectory/file.php works fine.

When trying to figure out what is causing this, I remembered that someone who recently did some work on this site had to add something to the .htaccess file. Here's what they added:

RewriteCond $1 !.(php|ico|gif|jpg|png|css|js|htm|html|txt|zip|pdf)$
RewriteCond $1 !^$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [L]

I haven't done much with .htaccess, so I really have little idea what any of the above means or does (although I know it does something important).

So I guess my question is, could this bit of code be causing my problem? And, if so, how can it be corrected without messing up what this code was put there for in the first place?

View 1 Replies View Related

Can I Use .htaccess With IIS

Jan 24, 2007

My application is on Windows plateform and using IIS as webserver.

Can I use .htaccess to secure my directory...

View 1 Replies View Related

Htaccess

Jul 12, 2007

Code:

RewriteCond %{QUERY_STRING} ^showtopic=([^&]+)&st=0$ RewriteRule ^forum/index.php$ [url]
I get a 500 Internal Server Error when I put that in my .htaccess file. Got it from [url]

View 5 Replies View Related

.htaccess

Jul 18, 2007

htaccess file that will redirect all requests for the domain to --

https://www.

so what I want is all traffic to be secure and use the 'www'.

View 11 Replies View Related

*.* And .htaccess

Jul 10, 2007

If I do rm -f *.* I see that .htaccess is not deleted

If I do copy -f *.* /somedir .htaccess is not copied.

Why?

What should I do to represent all files including .htaccess?

View 7 Replies View Related

.htaccess

Oct 4, 2007

i have a mobile download site.. now i dont want users to directly download from my site.. i mean hotlinking..

I hav a referal thing in my .htaccess

RewriteCond %{HTTP_REFERER} !^[url](/)?.*$ [NC]

Now there is a flashget like software for mobiles.. i want that my users are able to download using that software but the prob is that soft doesnt sends any referal info.. so in my .htaccess i want to allow that software and i am trying this

RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^.*FGet 1.0.*$ [NC]
RewriteCond %{HTTP_REFERER} !^[url](/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^[url](/)?.*$ [NC]
RewriteCond %{HTTP_REFERER} !^[url](/)?.*$ [NC]
RewriteRule .*.(zip|avi)$ - [F,NC]

where FGet 1.0 is the HTTP_USER_AGENT send by the software, but this doesnt works.. can plz give me the right code for it

View 6 Replies View Related

Htaccess

Sep 28, 2007

I'm have a bit of a mare getting some htaccess to work.

Here's my code:
Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-F
RewriteRule ^([-_!*$@~:.a-zA-Z0-9]+)$ [url]

The above works on a CPanel server but i've just moved the site to a fedora core 6, with standard httpd no control panel.

This is an entry from my log files:

PHP Code:
X.X.X.X [28/Sep/2007:11:51:34 +0100] "GET /my_profile.php?username=my_profile.php HTTP/1.1" 302 349 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)" 




For some reason it appends the my_profile.php to the end of the url, and it does it to any file in the same directory and just keeps going around in a loop, why would it do this?

View 3 Replies View Related

Redirect Old Url To New Url Using .htaccess

Jun 6, 2009

Apache redirect. I would like to point all the old site URLs to my site homepage e.g.

[url]should point to [url]

or better,

[url]should point to [url]

tell me the redirect code i need to add to my .htaccess file to make this work?

View 3 Replies View Related

Htaccess And UA Whitelist

May 30, 2009

What are the most common UAs? What I want to do is whitelist all the legit UAs and block the rest.

View 0 Replies View Related

Htaccess- Redirecting

Apr 26, 2009

I'm trying to redirect all people who go to [url]to [url]

I've got this but it doesn't do anything: (and I did verify that the .htaccess works, as

I added garbage text and tested and got an error).

Code:
Options +Indexes
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.mydomain.com/directory/$ [NC]
RewriteRule ^(.*)$ [url]

View 8 Replies View Related

.htaccess With ISAPI_Rewrite

Aug 19, 2009

I have just found out my server only supports .htaccess with ISAPI_Rewrite. Not quite sure how to accomplish this as in the past I just used normal .htaccess code. I just want to do a simple redirect so could anyone shed a bit of light on what I now need to pop in the file.

View 8 Replies View Related

How To Convert .htaccess To IIS

May 5, 2009

I'm transferring my website from Linux to Windows Server 2008 and I'd like to use IIS.

The problem is I have pretty complicated .htaccess file with complicated URL rewrite rules and redirections in it.

View 6 Replies View Related

Use Of .htaccess Generator

Jun 20, 2008

MarbleHost.com provides .htaccess Generator in their shared web hosting plans. Can you tell me what we use it for?

View 8 Replies View Related

Htaccess Not Being Read

Apr 1, 2008

I just hired my first dedicated server and I don't get why but it is like if it is not reading my htaccess files for mod_rewrite.

View 13 Replies View Related

.htaccess From Old To New Site ...

Mar 10, 2008

I'm trying to learn htaccess, but I'm having issues wrapping my head around this. I need to learn by example. Have several types of 301 permanent redirects that are needed.

Want to redirect a single page to a new page
OLD - [url]
NEW - [url]

Want to redirect a folder, AND any pages in it (preferably without naming EACH page), to a new folder's index
OLD - [url]
NEW - [url]

Want to redirect a subdomain to the primary domain
OLD - [url]
NEW - [url]

Want to redirect a folder, AND any pages in it, to a new subdomain
OLD - [url]
NEW - [url]

Using ISAPI_Rewrite 3 on 2003/IIS6, which uses htaccess commands.

Could anybody here show me what they would do in these scenarios?

I've read and read, and tried and tried, but it never seems to work out correctly. It either fails to redirect, or it redirects too much (some "open" type commands with a lot of variables will pick up the keyword -- for example, "students" -- so students.domain.com AND domain.com/students AND domain.com/program/students.html would all redirect, even though I only wanted the subdomain version, or the page version, to redirect, and not the others!).

View 3 Replies View Related

.htaccess Redirect

Apr 28, 2008

I know how to do a redirect to a new URL using a .htaccess file if I am pointing to a different server, however both domain.com and domain.com.cn are pointing to the same server, I just am wondering what I would add into my .htaccess file to get it to redirect from domain.com.cn to domain.com?

View 4 Replies View Related

.htaccess Subdomains

Jul 13, 2008

to have abc.mydomain.com redirect to mydomain.com/abc

to do this, I have:

1) created a DNS record at my hosting company, *.mydomain.com and it works, any made-up subdomain correctly points to my server.

2) using Plesk, I created a DNS record, *.mydomain.com

3) in an .htaccess file, I put:

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www.mydomain.com
RewriteCond %{HTTP_HOST} ([^.]+).mydomain.com [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/%1 [L,R]
... but the thing doesn't work, I keep getting the server's default page:

This is the Control Panel default page

If you see this page it means:

1) hosting for this domain is not configured

or

2) there's no such domain registered in Control Panel.

View 4 Replies View Related

.htaccess Mod_rewrite

May 28, 2008

I'm trying to redirect everything except the subdomains from an old domain to a new domain. The following appears to work so far:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^sub1.olddomain.com$ [NC]
RewriteCond %{HTTP_HOST} !^sub2.olddomain.com$ [NC]
RewriteCond %{HTTP_HOST} !^sub3.olddomain.com$ [NC]
RewriteCond %{HTTP_HOST} !^sub4.olddomain.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L]

But the subdomains also seem to be loading rather slow. Am I doing anything wrong here? Is there any way to optimise or simplify this (I have around 11 subdomains on the old domain)?

View 1 Replies View Related

.htaccess~ File

Oct 4, 2008

There is a .htaccess~ file in the root directory of my server. .htaccess is also in that place. But what is the purpose of that .htaccess~ file?

View 3 Replies View Related

.htaccess And Folders

May 22, 2007

In the public_html directory, I have

php_value user_agent "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0"
<IfModule mod_security.c>
SecFilterScanPost
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
Errordocument 404 /404.html
RewriteCond %{REQUEST_FILENAME} !.(jpg|jpeg|gif|png|css|js)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php [L]
</IfModule>

Then I created a new directory named caller

There is an exact same .htaccess in public_html/caller

However, the .htaccess in the public_html directory rewrites all request to index.php

.htaccess in public_html/caller rewrites all request to /caller/index.htm

The thing is when I access
[url] whatever the one that's called is /public_html/index.php

How can I arrange so that the one called is /caller/index.htm?

View 1 Replies View Related

Redirecting......(htaccess)

Apr 6, 2008

I have been trying for more than an hour to figure that out , but nothing....

I want to perform 2 types of redirects on my webpage/forum

I want all non-www to move to www.mysite.com/forums
and I also want the www.mysite.com to redirect to the /forums one...

All of those with WWW

I can make each work alone, but not these 2 together....

View 7 Replies View Related

301 Redirect In .htaccess

Feb 27, 2007

I am trying to redirect from:
[url]

over too:
[url]

Now the software i'm using on the /forums/ is different, so i need ALL inbound links to any area of phpBB2 to redirect to /forums/ and be stripped of the "index.php=topic111.22."

All the redirects I have tried seem to leave the rest of the URL on then give a page not found.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved