Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

2
votes
1answer
48 views

Apache - protect a subdirectory but not the root

I have a website, it should be accessible by anyone, but one directory should request http authorization. I have added following lines to website.conf: <Directory ...
0
votes
1answer
244 views

why apache returns error message in body while returning 200 status code

I've configured Apache to return 200 on all requests that made with OPTIONS verb: RewriteCond %{REQUEST_METHOD} OPTIONS RewriteRule ^(.*)$ $1 [R=200,L] The Apache indeed returns status 200 OK, yet ...
0
votes
1answer
281 views

why Apache's setEnvIf doesn't set correct header and how to debug it

I have the following in my .htaccess file: <IfModule mod_headers.c> SetEnvIf Origin "http(s)?:\/\/(www\.)?(inreado\.local|testenv\.inreado\.com|inreado\.com)$" AccessControlAllowOrigin=$0$1 ...
0
votes
1answer
41 views

Setting Expires Headers for Things Retrieved Via Query String

I have an installation of MediaWiki and have been optimizing various aspects using Google's PageSpeed tool as a guide, and I've so far been able to make lots of improvements. One thing I'm not able ...
1
vote
1answer
48 views

Specify which directores to look for .htaccess file

I'd read that enabling .htaccess for all directories causes a performance overhead, because all subfolders are also scanned for .htaccess files. I'd like to only have the .htaccess file read in: ...
3
votes
3answers
1k views

Configuring htaccess/mod_rewrite to serve static files with question mark in the URL

I've just taken on hosting of an ancient site that was converted from asp to static html, consisting of about 6,000 files. However, my server doesn't like the filenames, giving a 404 error. The URLs ...
0
votes
0answers
67 views

Rewriting .htaccess for https on subdomain

I'm currently hosting subdomain dev.example.com from a dev subfolder and using this .htaccess rules: RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?dev.example.com$ RewriteCond %{REQUEST_URI} ...
-1
votes
1answer
40 views

Do incoming https posts require https URL's

We would like to have HTTP posts from secure servers be secure on our end. Do the posts need to be made to https://ourserver.com, or does it work to post to http://ourserver.com, and then redirect to ...
0
votes
3answers
1k views

How to insert an “index.php” into every url using .htaccess?

Example: My Site gets called like that: www.example.com/controller/method/parameter1/parameter2 Now, .htaccess needs to rewrite this URL into: ...
-1
votes
2answers
73 views

301 redirect help needed for urls with parameters

How do I 301 redirect all urls such as http://domain.com/languages/italian/itemlist.feed?start=[0-9]&format=feed http://domain.com/languages/italian/itemlist.feed?format=feed&type=rss to ...
0
votes
0answers
31 views

Disable gd library on a specific website

I am trying to disable gb library on a specific website so it won't affect the other websites which are hosted on the same server. Is it possible to do this with htaccess or is there another way?
10
votes
2answers
3k views

SSL redirect on EC2 instance behind SSL terminating load balancer

I'm trying to redirect all url's to https in a web application. I have an ec2 instance behind an elastic load balancer. SSL is terminated on the load balancer. Any attempts at redirection end up ...
7
votes
2answers
2k views

Bypassing htaccess restrictions?

I found this in my apache access logs access.log:555.555.555.555 - - [05/May/2011:12:12:21 -0400] "GET /somedir/ HTTP/1.1" 403 291 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 ...
0
votes
0answers
16 views

Apache mod_rewrite with proxy to HTTPS from HTTPS host

I am trying to use the mod_proxy to rewrite internal one URL to another in this way: RewriteCond %{HTTP_HOST} ^www\.domain\.de$ RewriteCond %{SERVER_PORT} ^443 RewriteRule ^blog/(.*)$ ...
0
votes
0answers
7 views

htaccess rewrite rule for subdomain results to redirect loop [duplicate]

Below is my htaccess config: RewriteEngine On # if the domain starts with "apply." # i.e. apply.example.com # redirect to application URI RewriteCond %{HTTP_HOST} ^apply\. [NC] RewriteRule ...
0
votes
2answers
47 views

Setting htaccess rule for nginx

Hi i m having issue while setting htaccess rule in nginx. My htaccess is : htaccess rules are: RewriteEngine ON RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* ...
1
vote
1answer
41 views

Apache .htaccess - how to rewrite referrer?

I have a site www.example.com. I would like to achieve the following: All the visits that click on www.example.com from my other site www.example.net, to have the referrer www.example.org. In other ...
0
votes
1answer
690 views

Conditional Directory Index In Htaccess

This relates to the question in: http://stackoverflow.com/questions/1599717/conditional-directoryindex-in-htaccess The answer states that the following should work: SetEnvIf Remote_Addr ...
0
votes
1answer
731 views

.htaccess to PayPal & PayPal Sandbox

For testing on my pre-live site, I'd like to allow only my own IPs and PayPal Sandbox. For production, I'd like to allow only PayPal to my IPN listener. I can restrict in .htaccess to my IPs, but ...
0
votes
2answers
1k views

htaccess exception / “deny from all except Paypal”

I spent my evening on this problem and I did not find how to solve/bypass it :-( I have in "mydomain.com/admin/" a .htaccess file with the following : <Files ~ "[^index]\.php$"> Order ...
0
votes
1answer
158 views

Mod_rewrite Underscores to Dashes (or Hyphens) in Opencart

I'm transferring an e-commerce site to a new shopping basket. For some reason the old site used dashes for categories but underscores for products. So the full url of a product looks like this: ...
1
vote
1answer
963 views

How to hide cPanel directory [closed]

I have a server that uses cPanel. There is a built-in feature with cPanel where I can access the login area by going to domain.com/cpanel. I was wondering if there was a way to disable it or hide ...
2
votes
1answer
1k views

Hide cPanel login page? [closed]

I use the url http://example.org/cpanel to log in. This is accessible to anyone which seems like a bad idea as anyone can guess it's there. How can I hide it and make it accessible via .htaccess ...
3
votes
1answer
928 views

How to exclude IP from htaccess domain redirect [duplicate]

I'm trying to write a custom redirect rule for some testing purposes on 2 domains with exactly same site. The code I am using is: RewriteEngine on RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4$ ...
0
votes
2answers
53 views

Apache not allowing .htaccess

I upgraded my Ubuntu to 14.04 LTS and Apache to 2.4. When the server first started back up I was getting 403 errors visiting pages. This is when I learned I needed to change to Require all granted. I ...
2
votes
8answers
11k views

Excluding a directory from a root .htaccess rewrite rule to allow it to be password protected?

I have spent a tremendous amount of time the last week trying to figure this out, but no matter what I try I cannot get this to work. My web host said they did not have anyone who knew enough about ...
-1
votes
1answer
70 views

Apache: deny acces to directory but allow 1 file

I am using Apache 2.2.22 on Ubuntu 12.04. I need to disable access to directory /var/www/abc/ but allow access to file inside this directory /var/www/abc/README.txt. I try: <Directory ...
0
votes
1answer
124 views

PHP scripts fail after adding .htaccess to password protect a dir

I added .htaccess and .htpasswd to a dir in order to password protect it. That part works. AuthType Basic AuthName "Password Protected Area" AuthUserFile /path/.htpasswd Require valid-user But ...
0
votes
0answers
80 views

Avoid redirect loop using htaccess or php

I have searched for my specific problem using google and your sites search engine, but found nothing similar to my task. I am rewriting via htaccess internally to point to the specific site content. ...
-1
votes
1answer
68 views

.htaccess rewrite rule, extract number to query variable [duplicate]

I'm migrating a huge site from an old proprietary CMS to WordPress and need to redirect the old URL structure. The old system has all kinds of whacky URLs, but the one thing common to them all is ...
1
vote
1answer
114 views

.htaccess query string blocking phpmyadmin [closed]

After phpmyadmin login, I get this error message Error in Processing Request Error: 403 Error text: Forbidden" I found that removing the following lines from .htaccess it doesn't give any error ...
1
vote
0answers
81 views

how to serve a single page application with openshift

I'm tryng to deploy a single page app on openshift. On openshift all the static contents have to be in wsgi/static dir, but I obviously want to serve my static index.html from the root. Every attempts ...
0
votes
0answers
6 views

RESTful Webservice: .htaccess linking to higher level hierarchy [duplicate]

I have this RewriteRule for apache: RewriteRule ^locations/([0-9]{1,})$ index.php?id=$1 It is positioned in public.www/medmec-api/.htaccess and the rule does work for ...
0
votes
0answers
147 views

Dynamic Subdomain with htaccess unchanged URL

I have a Codeigniter project Located at "domain.com/users/abc" directory. I want to access it with Subdomain "abc.domain.com/" and also I don't want the url in the address bar to change. There will ...
0
votes
0answers
17 views

Openshift wordpress non www to www redirect via .htaccess [duplicate]

I am running wordpress on openshift, i want to make non www to www redirect. I have read this answer. I have added .htaccess file into .openshift/config directory. My .htaccess contains following ...
1
vote
1answer
105 views

.htaccess recommendations to prepare for new launch of website - caching

Currently my website has cache controls set for javascript libraries and images, and caches them for one week. I'd like to know what best practices I should following leading up to my websites ...
-1
votes
1answer
54 views

Recommended sequence for directives in htaccess?

Thanks in advance for comments and suggestions. My wordpress site was hacked so I deleted it and started from scratch beginning with a proper htaccess document. As I was configuring the htaccess ...
1
vote
2answers
100 views

htaccess problem

I have a few lines in my .htacess Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^mydomain.org [NC] RewriteRule ^(.*)$ http://www.mydomain.org/$1 [L,R=301] # index.php to / ...
5
votes
4answers
3k views

Returning 404 code for unauthorized attempts

I have an admin directory on my web server (http://test.com/admin) and I don't want unauthorized parties to access this /admin/ directory instead I want to return 404 error code for all unauthorized ...
0
votes
0answers
13 views

htaccess to redirect blog but not attachments

I have a wordpress blog which moved from the directory /blog to the root directory. I would like to redirect the entire directory to the new blog which is now /category/blog The problem is that ...
1
vote
4answers
2k views

apache 2.4, mod_proxy_fcgi not honouring .htaccess, work around needed

I am using apache 2.4.7 with mod_proxy_fcgi for purpose of passing through php to php-fpm (this will be used for shared hosting environment). The htaccess works fine for non php files, but once it hit ...
-1
votes
1answer
37 views

New domain and HTTPS redirects [duplicate]

I have a domain.co and just bought domain.com and want to use SSL on it. Having in mind this H5BP apache config for HTTP to HTTPS redirect: <IfModule mod_rewrite.c> RewriteEngine On ...
0
votes
0answers
82 views

Unable to redirect Https to http using htaccess

I'm trying to redirect https://example to http://www.example.com. I just migrate from one provider to another and my website on google search are index as Https , when I visit the page I get : ...
1
vote
2answers
38 views

Force https before authentification - no access to vhost

I am a beginner when it comes to servers and I have a problem similar to this one. When accessing the desired webpage, .htpasswd prompts me for an authentification before I am redirected to https. ...
1
vote
2answers
2k views

How to add an additional RewriteCond to exclude a specific url?

I have an existing .htaccess file with the following rewritecond: RewriteCond %{HTTP_HOST} !^go\.domain\.com$ [NC] RewriteRule ^(.*)$ https://go.domain.com [R,L] In essence, everything on this ...
0
votes
0answers
57 views

What am I doing wrong in this code?

I want to redirect any request, adding a ".php" at the end of the request URI. But, if the URI has a slash ("/") at the end, I want to remove it and add .php at the end of the URI. The code below ...
0
votes
1answer
35 views

Moved an old wordpress site to another folder on the server, but it is still redirecting even though there is no .htaccess file

My friends site got some malware or something, so he decided to stop using wordpress and have me build his website from scratch. I have never used wordpress in my life, but I FTP'd into the root ...
-1
votes
1answer
114 views

Setting a custom value to the DeflateBufferSize results in 500 internal server error

I'm trying to reset the DeflateBufferSize directive like so in my .htaccess file: DeflateBufferSize 1024 SetOutputFilter DEFLATE But the result of each page is then 500 internal server error (this ...
9
votes
11answers
1k views

.htaccess doesn't redirect to www-prefixed page properly

I'm trying to redirect an url without www. to www.version (example.com to www.example.com). I use the usual RewriteCond %{HTTP_HOST} ^example\.com [nc] RewriteRule (.*) http://www.example.com/$1 ...
0
votes
0answers
47 views

How to enable deflate compression for files?.ht

I am hosting my website on Godaddy. How do I enable compression for CSS and JS files? To compress JS and CSS files I am placing the following snippet in the JavaScript directory: SetOutputFilter ...