Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
16 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
204 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
138 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 %{...
1
vote
1answer
48 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
48 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 %{...
2
votes
1answer
58 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
107 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
109 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
14 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
49 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
293 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
90 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
207 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
147 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
46 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
18 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
107 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
57 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
239 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] /var/lib/...
0
votes
0answers
40 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
175 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
45 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
198 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
33 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, x-requested-...
1
vote
1answer
85 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, /var/www/obtf2)...
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
175 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 http://subdomain....
1
vote
2answers
104 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
28 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
53 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 www.domain....
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
133 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
3k 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
38 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
42 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
250 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
105 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
64 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
287 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 mas.domain....
1
vote
1answer
38 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 valid-...
0
votes
0answers
97 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
54 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
128 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 ...
0
votes
1answer
33 views

Apache keeps returning 500

(Im working with Apache/2.4.10 on Windows 7 (64 Bit) ) I have a directory "test" in my document root with several files on my local apache: test |____.htaccess |____.htpasswd |____admin.php |...
1
vote
1answer
117 views

How can I force mod_rewrite to send user info component of a URI?

A colleague recommended I repost this from StackOverflow to ServerFault: This has been driving me crazy. I have a web application that's being served via Apache Web Server. The database server that ...
-2
votes
1answer
81 views

Equivalent of .htaccess in NGINX

I have the following .htaccess file. I am trying to configure this on NGINX with no luck. .htaccess RewriteEngine On RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{...
0
votes
0answers
12 views

Can't redirect HTTP to HTTPS for subdirectory [duplicate]

The following code (in my root level .htaccess file) should redirect http://www.pillerdesigns.com/iwp/ to https://www.pillerdesigns.com/iwp/ (non-SSL to SSL): RewriteCond %{HTTPS} off RewriteCond $1 ^...
1
vote
1answer
264 views

Redirect IP to a domain name using htaccess

Let's say I have this IP Address 11.12.13.14 and the domain example.com. Now what I want is to redirect the user from IP Address to domain name (but without changing the domain name to address bar). ...
2
votes
2answers
143 views

Apache security - list all possible handlers / actions

To ensure there aren't security weaknesses that can be exploited via .htaccess, how can we see all possible handlers that Apache can use via directives like SetHanlder and AddHandler. I know I can ...