Questions tagged [htaccess]

The tag has no usage guidance.

0
votes
0answers
19 views

Centos7 Delete .htacess file [on hold]

i have created a .htacess file for my site and now im getting a 500 error on the site, how can i delete the file to start again. Thanks in advance
0
votes
1answer
16 views

htaccess redirect problems

In my var/www/html/ folder there are 2 Angular applications. One is search and the other one login. There is no index.html file in /var/www/html/ only 2 folders which contains each a index.html file. ...
0
votes
1answer
27 views

How to block empty user agent

I'm using CentOS 7 on my server, and Apache2 as my web server. In AWStats in my Cpanel, I could see that I've a large bandwidth used by a bot called "empty user agent string" (see the pic attached). ...
0
votes
0answers
9 views

htaccess: disable pdf caching - is it possible on hosted site?

I would like to know if I can make sure with .htaccess that I can send headers to browsers so that PDF files from that directory are not cached. I do understand what to send, but my question is - ...
1
vote
0answers
30 views

Redirect http->https, but exclude subdomain

I use Drupal, with a complicated multi-Domain setup, and have a local development site, that uses (locally) the dev. subdomain. So I want a .htaccess file that can be used on production AND ...
0
votes
2answers
23 views

Add lines in every /public_html/.htaccess file

Is there a way to perform an .htaccess edit in bulk through ssh? I have multiple websites which goes like this: /home/user/website1/public_html/.htaccess /home/user/website2/public_html/.htaccess .....
2
votes
0answers
82 views

Limitations of using “require user” multiple times in .htaccess in an Apache config? [closed]

Access to a Apache website can be controlled with a line as Require user john paul george ringo in a .htaccess file. See https://httpd.apache.org/docs/2.4/mod/mod_authz_user.html. This same rule ...
0
votes
0answers
115 views

How to execute a cgi pointed to by a symlink?

My website has several cgi's (executable binaries compiled from C source, in case that matters) that work fine when run from a browser as, e.g.,       http://mydomain.com/cgi-bin/...
1
vote
2answers
353 views

.htaccess file ignored by apache

I am working on a web application built using php in codeigniter. Everything works fine in localhost. However .htaccess file is being ignored by my live server (RH7.1 Apache 2.4) despite Overide All ...
1
vote
3answers
7k views

How to zip all files including hidden files to zip file using linux command? [closed]

I have linux hosting and wanted to zip everything in one single zip file but all time .htaccess file is excluded and other hidden files are not adding to zip file.
0
votes
1answer
835 views

How to allow pdf files in .htaccess?

I have this following codes in my htaccess file, but it doesn't allow pdf file to open, it will redirect to 404 page. how can I allow pdf files to open based on my following htaccess file. ...
0
votes
1answer
82 views

Setting Options -Indexes recursive [closed]

Is it possible to turn off all indexes for all folders without having to upload the options to every folder? This is a shared hosting unix server, so server config is not available. Solved Even ...
1
vote
1answer
2k views

Restrict access to subdirectory in Apache

I've a very easy question. However I have been digging all the manuals for an answer for a full day already. What I want is to configure Apache to give anyone read access to /var/www but restrict /...
0
votes
1answer
323 views

Use HTACCESS File to limit access to IP only half working

I am trying to use my HTACCESS file to block all IP's but the ones I want to whitelist. Below is my HTACCESS FILE: <LIMIT GET> order deny,allow deny from all # whitelist Boston IP allow from ...
0
votes
1answer
469 views

Conditional .htaccess Redirection

There are many questions and answers on this topic. But I'm still stuck! I've my basic .htaccess in my site that's working great and redirecting everyone my new site's home page. Options +...
1
vote
1answer
17 views

More succinct way to block a list of folders in .htaccess

I inherited a php website where the website root is in the top of the project. There is a list of files I don't want accessible from the web server. I setup my htaccess like so: <LocationMatch "\/\...
1
vote
0answers
42 views

htaccess Rewrite Rules issu

I am struggling with my RewriteRules. I want to handle requests as follows: Requests that match example.com/15 (domain/any number), should be handled by my cdn. So I wrote this, but it does not work: ...
1
vote
1answer
3k views

Redirect Main domain and subdomain from http to https

i want to redirect these sub domains and main domain from http to https and sub blogs too. Home directories WWW (Wordpress): /home1/placehq5/public_html/.htaccess My Somadome (PHP): /home1/...
0
votes
1answer
55 views

Limiting Scope of File Writing by PHP Script

I am in the process of writing a PHP script that will add IP address blocks to the .htaccess file. My concern is that I do not want to have the .htaccess file open to the web server user for general ...
1
vote
1answer
222 views

Subdomain returns forbidden, 403 errors - has to do with .htaccess

I work on a domain and any number of subdomains, which are hosted externally. Inside the directory for the subdomain, there is a .htaccess file, as there are in every subdomain directory. When ...
0
votes
1answer
490 views

how to force redirect from http to https with htaccess?

I need to force, with htaccess, redirect from http to https of a website. Required when use shared hosting like dreamhost.
3
votes
1answer
1k views

How to test '.htaccess' from command line

I'm trying to track down the cause of an intermittent Apache Internal Server Error during MediaWiki edits and uploads. Some sources tell me to check .htaccess for errors. I can audit for .htaccess ...
1
vote
1answer
111 views

DirectoryIndex not redirecting

I am fairly new to apache and was a SQL Server database admin in a former life so please forgive my ignorance. I am trying to set up an Apache web server (HP-UX flavor) to conform with the DOD STIGs ...
1
vote
1answer
2k views

Fail2Ban monitor HTPasswd/HTAccess

So i tried putting this in jail.local and restarting fail2ban but no go. [apache] enabled = true port = https filter = apache-auth logpath = /var/log/apache*/*error.log maxretry = 5 [apache] ...
1
vote
1answer
1k views

How to use Fail2Ban to protect ProxyPass(ed) applications

So I recently configured an application that uses WebSockets and I am using Apache proxy pass to pass on the application via domain.com/application The problem is the application is very bare metal. ...
1
vote
2answers
860 views

why isn't .htaccess redirecting requests on CentOS 7?

A web app running on CentOS 7 with Apache 2.4 recently changed its domain name from olddomain.com to newdomain.com. The structure of the app at the newdomain.com is different than on the olddomain....
0
votes
1answer
39 views

How do I override a FILES rule?

There is a directive that denies access to all index.html (file name used for example only). <files index.html> errordocument 403 http://mydomains.com/no-access.html order deny,allow deny from ...
0
votes
1answer
360 views

HTAccess: Redirect a subdomain to a another protocoll

I would like to make a rule for a subdomain, so my teamspeak subdomain will directly be redirected to the ts3 protocol. So, let me show you an example: RewriteCond %{HTTP_HOST} ^(ts\.)?example\.com$ ...
1
vote
3answers
9k views

Deny access to subfolder and file with .htaccess

I need to deny access to configuration files under some subfolder. Currently I have this rule but it doesn't work: <Files ~ "((foo|bar))$"> Order deny,allow Deny from all </Files> If ...
1
vote
1answer
2k views

How to deny access for virtual directories in .htaccess for all IP, and accep for 1 IP?

When you need to deny access to folder for all IP you should to put .htaccess in this folder, which must contein: Order Deny,Allow Deny from all Allow from 1.1.1.1 You can do it in virtual hosts ...
0
votes
2answers
233 views

How to Replace IP field in Rewrite Condition

.htaccess file contains below excerpt to block specific files and folders. RewriteCond %{REQUEST_URI} wp-login.php|wp-admin RewriteCond %{REMOTE_ADDR} !^123.456.789. RewriteRule . - [R=404,L] I need ...
1
vote
1answer
183 views

Htaccess - Map dynamic URL query to a static file

I'm trying to map this dynamic query: /wp-admin/admin-ajax.php?action=mymail_form_css to this static file: /wp-admin/mymail_form.css What I've tried so far which doesn't seem to work is this ...
0
votes
1answer
589 views

stop IP address to land on website home page [closed]

I notices that when i type my VPS IP address in address bar then it display website home page. So it may case duplicate content. Can you please tell me How to stop IP address landing on website home ...
4
votes
2answers
16k views

Authenticate users via LDAP using nginx

I know how to auth the users via LDAP in apache2: # put the following in the VirtualHost <VirtualHost *:443> ServerAdmin user1@bar.foo.com DocumentRoot /var/www <Directory /&...
1
vote
0answers
294 views

Need .htaccess Rewrite Rule To Remove Trailing <br%20/>

I have links that for some reason have a trailing <br%20/> and I don't know where they are coming from to try and fix them. So I need a general rewrite rule to remove them so the links won't ...
0
votes
1answer
154 views

Incorrect Directory Index

I am attempting to load as the default DirectoryIndex home.html, but the site keeps jumping to index.php. Website is built on WordPress. httpd.conf DirectoryIndex index.html home.html index.php ...
1
vote
1answer
231 views

htaccess Rewrite Issue

I have been attempting to correct an issue that I'm experiencing with WordPress. Following the advice on the WordPress.SE site I've tried to resolve it with an .htaccess rewrite rule, but for some ...
0
votes
1answer
423 views

CentOS test page and .htaccess

When I use the line below in the .htaccess file, I get the Apache CentOS test page. RewriteCond %{REQUEST_FILENAME} !-d How can I fix this?
1
vote
0answers
935 views

HTTPS Authentication problem : Polipo

I use internet behind http proxy, and that requires authentication. I tried using polipo to bypass the authenticated proxy to 127.0.0.1:9134. Applying these settings to my browser, works fine for ...
3
votes
1answer
3k views

How may I distinguish encryption algorithm of htpasswd?

I have an apache web server running on Debian Linux and I secure a certain directory with htaccess. I have no history or knowledge how the .htpasswd file was created. Apache documentations says that ...
0
votes
1answer
2k views

control Apache referrer to restrict downloads in htaccess file

I want to restrict a file server just for people come from an specific URL: http://graymind.ir How should I config .htaccess file to do this.
1
vote
1answer
1k views

Where would I find where an .htaccess file is located and being used on a Mac OS X Lion server that sets Basic Auth on an Apache server?

I've installed some software, namely, a continuous integration (CI) server (Jenkins) on a Mac Mini running Lion Server. The server, by default, runs from port 8080 on local host via the url: http://...
0
votes
1answer
158 views

If htaccess doesn't use cookies, then how does it identify the client?

If I log in to my site that I protected with htaccess (so it pops up for a username/pwd) then I can't see any cookies. But why? How could the server identify that I'm the one that already logged in to ...
0
votes
1answer
164 views

osCommerce hacked

I had my osCommerce hacked a few moments ago and the morons are using it to send emails. I have identified that they placed scripts inside osCommerce images directory. Is there a way to forbid ...
0
votes
1answer
1k views

Why is rewriting in htaccess not working on this server

I'm moving code from a server that served a single domain to one that serves multiple domains. I'm using named virtual hosts to handle the different domains. The url rewriting is not being executed I ...
1
vote
2answers
2k views

RewriteRule to cause subdomain to load another DocumentRoot?

I could sure use a little help with what I am trying to do with a RewriteRule in .htaccess: ...to causes URLs using our sharpedge. subdomain to auto-load from the Internet_IE directory - one level ...
2
votes
1answer
5k views

conditional DirectoryIndex based on IP address, using .htaccess

I've got this in httpd.conf: <VirtualHost xx.xxx.xx.xxx> Options All +ExecCGI ServerAdmin hostmaster@thehost.com DocumentRoot /var/www/html/domain.com ServerName dl.domain.org ...
3
votes
1answer
905 views

How to redirect traffic from subdomain to main domain

I have a demo.domain.com and domain.com they both show the same information and point to the same folder. How can I redirect all demo.domain.com visitors to domain.com?
2
votes
1answer
181 views

IPv6 address changed after upgrade. Why? and how can I harden my .htaccess against this?

I noticed in my local webserver logs that the IPv6 address of my desktop changed after upgrading to Kubuntu 12.04. inet6 addr: identical:identical:identical:identical:changed:changed:changed:changed/...
2
votes
1answer
1k views

403 forbidden issue - .htaccess [closed]

I am getting 'Forbidden' 403 problem with my website. Earlier today it worked. The only thing I did was try to access other folders (eg bin). I checked permissions, and it all seems to be looking ...