Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

2
votes
1answer
32 views

How can I override the default Apache HTML directory?

Probably a simple one, but this has me confused. I'm running an EC2 instance which installs Apache 2.2 to the box once provisioned. I don't have access to a2enmod there but I need to change ...
0
votes
0answers
46 views

Apache Options +Includes is ignored

I have the main config file of Apache/2.4.17 (Unix) with: DocumentRoot "/usr/local/apache2/htdocs" <Directory "/usr/local/apache2/htdocs"> Options Indexes FollowSymLinks AllowOverride ...
1
vote
1answer
60 views

Can't get included CSS and JS files to be compressed

I have enabled compression via .htaccess and in httpd.conf However when I run it through the various online testers, its always saying that various included files are not compressed. Apache version ...
0
votes
0answers
23 views

Apache htaccess precedence

I am wondering about the order of precedence within an htaccess file. I have a RedirectMatch outside of any block that is being over-ruled by a FilesMatch directive later in the file. How can I ...
0
votes
1answer
126 views

Can I use Gulp to modify my .htaccess file with different configurations for Dev & Production?

I have two CentOS boxes running Apache. One is my dev environment and the other is my production environment. I am looking at using Gulp in a process of pushing from my dev server to my production ...
0
votes
1answer
14 views

.htaccess not behaving as desired

Eventhough I'm new at htaccess, I've been learning a lot in the past few days, but I'm stuck on a certain part that resulted in the website not behaving as desired. Here is the part of the code where ...
2
votes
2answers
106 views

Special characters in URL causes custom redirect to fail

I have a domain on which I am trying to set custom redirects for the error pages. My .htaccess file looks like so: RewriteEngine On AddDefaultCharset UTF-8 DefaultLanguage en-US # disable TRACK and ...
-2
votes
1answer
72 views

How to rewrite URL by removing the last two characters within the htaccess file?

How to rewrite a URL by removing the last two characters within the .htaccess like following? /blog/?m=20150218 rewrite to /blog/?m=201502 I have tried for following but not working: RewriteCond ...
-2
votes
1answer
72 views

(Amazon AWS) How to redirect an old domain to a new one-While not having any server for the old domain anymore (so I cant redirect it using .htaccess) [closed]

I had this website: www.example.pro and now I created a new website using Amazon AWS, and bought a new domain: www.example.com. I defined everything on Route 53 on Amazon. Everything works perfect ...
1
vote
1answer
30 views

.htaccess redirect only for homepage?

My website has more languages and I want to do this redirect for every languages for example: /es/ to /es, simple with Redirect but this method make problems for subpages, how can I tell htaccess to ...
0
votes
1answer
28 views

System error in Apache with combination of https redirection plus password requirement plus error document

In an Apache 2 vhost I have the following configuration (in my case, in .htaccess of the document root (which is for simplicity the same for http:80 and https:443) RewriteEngine On RewriteCond ...
1
vote
1answer
38 views

Is it possible to limit connections per “user agent” in htaccess?

Say my goal is to limit the number of users visiting my site concurrently via "Mozilla" (firefox) user agent, is it possible to do in apache 2.2? I'm thinking using something along the lines of: ...
-1
votes
1answer
77 views

Is there any way to make Nginx use .htaccess files?

I know .htaccess files are very detrimental Apache's performance and are avoided by Nginx because they are considered "doing it wrong." Unfortunately I have to support a massive web app that is built ...
0
votes
1answer
53 views

VirtualHost/htacess : how to point a subdomain to an url parameter?

I must to create a multi-languages website. In order to achieve this aim, I want to point subdomain representing a language to the 1rst url parameter (GET variable) of the domain in my virtualhost ...
0
votes
0answers
13 views

Forcing HTTPS across site is intermittent

I've a Wordpress site on my server. Within it's root directory I've got my htaccess file. Within this file I've the following lines of code: #Begin https redirect RewriteCond %{HTTPS} off RewriteRule ...
0
votes
0answers
37 views

protect a wordpress url with .htaccess password method

I have a WordPress site, where I want to restrict user access for certain URLs (i.e site.com/training/private and all the URLs that follows /private/) through .htacces method I have used the below ...
1
vote
1answer
113 views

Exclusion of a protected sub-url does not work on Apache 2.4?

I try to exclude a sub-url "/shop/api" from my protected website. It worked fine on different server on Apache/2.2.15 but now not with Apache/2.4.7? It always asks for the basic authentication. Any ...
-1
votes
1answer
58 views

I can't prepend HTTP://WWW to the URL when I redirect to the same domain

There is this WordPress application on OpenShift that uses CloudFlare as DNS server. OpenShift gives us a URL such as app-user.rhcloud.com and allow you to add alias. Such as www.website.comand ...
0
votes
0answers
137 views

Redirect my main domain to https using .htaccess, not sub domains

My main site needs to 301 redirect to https but I have other sites housed in that folder. They work fine as http but if I need to redirect a parked domain to that sub-site it attempts to force https. ...
0
votes
0answers
80 views

Prerender with my angular application

ive asked this question on Stackoverflow and got suggested to try here so i am hoping some of you can help: I have followed the following guide: In angular: $locationProvider.html5Mode(true); In ...
-1
votes
1answer
34 views

Mod rewrite regex htaccess

I've been using mod_rewrite in order to block some user agents but now, I'm getting an 500 Error and error_log: /var/www/htdocs/.htaccess: RewriteCond: cannot compile regular expression I think ...
0
votes
0answers
16 views

Direct two web pages to https while maintaining the rest in http

I am successfully directing my profile page to https while keeping the rest in http. I am having trouble adding another page to be directed to https without causing an infinite loop. The page I am ...
0
votes
1answer
73 views

Redirect to Maintenance file with .htaccess

i'am trying to do a simple redirect to a maintenance page, but seems like apache won't let me do ! i have a folder for 3 version of a wiki (each with a specific language), so i want to redirect each ...
1
vote
0answers
45 views

Using Apache mod_rewrite to rewrite host to subfolder, but it redirects instead of rewrite

I want to simulate virtual hosts by .htaccess, so I want to rewrite hostname to subfolder. It works, but on some URLs it don't rewrite but redirects. This is my .htacess file: RewriteEngine on ...
0
votes
0answers
27 views

SSL Subdomain redirects to servers IP Address [duplicate]

I have a server with Apache installed under FreeBSD. I have enabled rewrite rule and applied it to .htaccess (can be seen below); Ref: http://stackoverflow.com/questions/9985735/redirect-ip-to-domain ...
0
votes
0answers
154 views

/var/lib/tomcat7/webapps/ROOT/.htaccess: DeflateCompressionLevel not allowed here

i have absolutly no idea about this failure. I always get this Error when i set to "DeflateCompressionLevel 9" in my .htaccess In the Apache error log: [alert] [client 192.168.1.12] ...
0
votes
0answers
26 views

Disable redirect using htaccess

I have the following www.mywebsite.com/page1 I have written a redirect statement that takes the user to this page when encountering a certain condition. That condition also exists within the ...
-1
votes
2answers
84 views

Block direct access to port 3838 when using shiny

I have a shiny server listening on port 3838 (Centos 6 Environment). I would like to block direct access to http://www.mywebsite.com:3838 which reveals the shiny files and directories. Any time I ...
0
votes
1answer
38 views

Write .htaccess file to configure subfolder as documentroot

I have the following directory structure. /var/www/html is the DocumentRoot. var www html demo css abc.css js abc.js index.html How can I ...
0
votes
1answer
157 views

Nginx rewrite subdomain to subdirectory without changing the URL

I've been using Appserv for a while and moved to Nginx for now. When I was running my website under Appache I had this configuration in the .htaccess file in order to link the subdomain to the ...
0
votes
0answers
27 views

htaccess to add cors headers and redirect to cgi-bin

Quite simply I need to add some cors headers (preferably) via htaccess, like so: Header always set Access-Control-Allow-Origin "*" Header always set Access-Control-Allow-Headers "origin, ...
1
vote
1answer
55 views

Using multiple .htaccess files with multiple ErrorDocument 404 entries

Here's what I'm trying to accomplish. Right now, in /var/www I have an .htaccess file with multiple ErrorDocuments defined for various errors. I also have subsites (i.e. /var/www/tf2c, ...
0
votes
1answer
19 views

Protect a directory if remote host is/is not

How can I protect a directory within .htaccess only if the remote host is not 192.168.1.11 ? Below is how I actually protect directories: AuthUserFile /home/personal/.htpasswd AuthName "Auth Area" ...
-3
votes
1answer
107 views

.htaccess causes infinite loop on live server but works on localhost [duplicate]

I'm a newbie .htaccess and regex. I have a script that works locally but when I upload it to a live server it causes an infinite loop. How can I fix this? On the site when you load ...
1
vote
2answers
66 views

Apache 2.4 Convert .htaccess rewrites to vhost.conf

I have a .htaccess rewrite that I would like to move to a vhost.conf (I don't want to use .htaccess) RewriteRule ^(.*?)(test_mod_rewrite) /$1media/plg_jchoptimize/assets/modrewrite.php?q=$2 ...
0
votes
0answers
16 views

Ganglia private page

I have read the Ganglia documentation about authorization systems (https://github.com/ganglia/ganglia-web/wiki/Authorization-System). I would like to restrict all access to the page via htaccess so ...
1
vote
1answer
46 views

Redirect rules for .htaccess with mod_rewrite

I have a PHP script dynamically generating content from a database based on queries. The user might do a search from a text box for the username "mark". The content is provided by PHP at ...
2
votes
0answers
20 views

How To Stop Apache Logging Client Denied By Server Errors [duplicate]

I get an annoying amount of spam traffic from the Ukrane, Russia, Korea etc. I have setup rules in my .htaccess file to block all of these countries and it's working great. The problem i have now is ...
0
votes
0answers
91 views

Converting NGINX to apache rewrite rules

Currently I am doing a project setup in my local(Apache) whichi is in NGINX. I am facing trouble in converting the rules from NGINX to .htaccess rules. Can some one help me out in converting the ...
0
votes
4answers
1k views

How to block Ip in .httaccess on Apache 2.4

I've upgraded Apache 2.4 and would like to block an Ip this could be done by using the following in the .httaccess on Apache 2.2 Order Deny,Allow Deny from 50.62.136.183 However how can I achieve ...
0
votes
1answer
35 views

Some mod_rewrite syntax clarification

We inherited some code recently and I'm reviewing the .htaccess file of one of the sites. I understand what the end result of most of the rewrite rule sets are, I'm just unsure of some of the syntax. ...
0
votes
1answer
35 views

Convert htaccess rewrite rule

I want to convert this to nginx rules # BEGIN EAP Rewrite <IfModule mod_rewrite.c> RewriteEngine on Options -Multiviews RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f ...
0
votes
2answers
155 views

htaccess rule to rewrite %3F to ? and %3D to =

I need to rewrite the URL of my site which contains %3F to ? and %3D to = I have tried this rule: RewriteCond %{HTTP_HOST} myhostname RewriteRule ^(.*)%3F(.+)%3D(.+)$ $1?$2=$3 [L,R=301] ...
-1
votes
1answer
80 views

Block all bots from .ru domains via robots.txt or htaccess? [closed]

Is there any way to write rules for robots.txt or htaccess that will block all bots that come from a .ru domain? Thanks
0
votes
0answers
46 views

Combine modrewrite condition to avoid double redirects

There are two modrewrite directives in my htaccess file. One is redirecting uppercase URLs into lowercase. The other one is redirecting http and www requests to https and none www. #Redirects ...
-1
votes
1answer
165 views

apache 2.2 order deny allow not working

this is driving me nuts. In a web server running httpd-2.2.15-45.el6.centos.x86_64 any type of does not seem to be honored. Example: <VirtualHost 192.168.10.10:80> ServerName ...
1
vote
1answer
33 views

How to execute script before Apache basic auth?

I need to protect some location with htpasswd and that is working ok with: <Location /myloc> AuthType Basic AuthName "My Protected Area" AuthUserFile .htpasswd Require ...
0
votes
0answers
75 views

Does domain pointer overrule .htaccess redirect from country tld to .eu tld or is there workaround?

I've been trying to redirect with a .htaccess file but its not working. Now I think I know why, just need a second opinion. I have domain pointers set from a .nl domain and a .lv domain to point to ...
0
votes
0answers
33 views

Apache ErrorDocument fails for subdirectories

I'm using the following in an .htaccess file to allow only traffic from my ip, i.e. put the site in maintanence mode. ErrorDocument 403 /maintenance.html Order Allow,Deny Allow from 11.22.33.44 It ...
1
vote
1answer
88 views

Authorization Required! – 401

We have a weird problem and we can't figure out what's causing the issue. Randomly, some of our visitors get the following error: Authorization Required! – 401. This server could not verify that ...