Questions tagged [htaccess]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
25 views

FilesMatch htaccess syntax pain for apache 2.4

someone please tell me why this doesn't work in .htaccess? #grant access if word-processing format <FilesMatch "\.([Pp][Dd][Ff]|[Dd][Oo][Cc][Xx]?|[Rr][Tt][Ff]|[Oo][Dd][Tt]|[Tt][Xx][Tt]|[Ww][Pp]...
0
votes
1answer
49 views

Problems with .htaccess and slash

I'm trying to solve a problem with .htaccess. I have this lines in my .htaccess, but the website still have a "with slash" version. Sorry, it's an erotic page https://carlamila.es/...
0
votes
0answers
18 views

.htaccess issue

I have a script which I distribute into each folder per user. Each folder is identical in files apart from the /lib/config.ini.php file. I wish to let them all use the same 1 set of core files ...
-1
votes
2answers
53 views

SED for thousand of 301 redirections on htaccess?

I got a headache with URLS after change them on one of my websites. The URLs were very long and I decided to change them despite the later change via .htacces... I'm making the change one by one (I ...
0
votes
1answer
124 views

can't browse to subdomain on apache server, getting forbidden resource permission

I have cPanelA with website A...with subdomain A1 - all is working correctly. I have created a new cPanelB with website B...and need to move subdomain A1 over to cPanel B as subdomain B1. Website B is ...
0
votes
0answers
110 views

After installing SSL Certificate VTiger is giving an error?

We recently installed the latest available version of vtiger Kernal version : 2.6.32-954.3.5.lve1.4.78.el6.x86_64 Version used : VTiger CRM 7.3 (Open Source) Hosting : GoDaddy Deluxe Linux Hosting ...
1
vote
0answers
46 views

Apache2, folder is not visible, without .htaccess is ok

I configured apache2 server on my local and server, same configuration. Problem is, that on my local there is not visible folder, where is .htaccess file. But on server, with same configuration and ....
0
votes
0answers
23 views

Using htaccess and htaccess file to configure a folder to be accessible via web only by specific user

I do apologize in advance for my dumb question because I am a beginner in Linux and CentOS. How can I use an htaccess file and htpasswd file to configure the new folder to be accessible via the web ...
0
votes
1answer
3k views

How to Block all Bots using .htaccess? [closed]

I have noticed that Bing bot doesn't follow robots.txt rules Because i disallowed all bots but Bing bot doesn't follow the rules I block some bots using .htaccess is there a code to Block all Bots?
0
votes
1answer
979 views

How enable content-length header using .htaccess?

I have a seriously big problem, when i download any file for example: myfile.zip, or when i load a page for example: myserver.com/welcome.html, the response headers not include content-length and the ...
0
votes
1answer
31 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
842 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). ...
1
vote
0answers
50 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
254 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
2k 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 ...
1
vote
0answers
400 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
722 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
15k 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
2k 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
157 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
4k 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
350 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
647 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
19 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
57 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
4k 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
75 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
409 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
564 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
2k 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
147 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 ...
2
votes
1answer
3k 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
1k 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
43 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
409 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$ ...
4
votes
3answers
20k 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
249 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
212 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
734 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 ...
6
votes
3answers
21k 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
315 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
160 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
237 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
427 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
1k 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
4k 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://...