Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
1answer
152 views

Apache2: Allow directory indexing, but restrict file access by type

I need to configure my Apache2 server (version 2.2.22) such that I allow auto-indexing of the WWW root folder and its sub-directories, but restrict access (i.e. restrict download) to just a set of ...
0
votes
0answers
31 views

.htcaccess RewriteRule without 301/302 error

I added the following Redirect-Rule to my .htaccess-file for my entire website: RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^([^\.]+)$ $1.php [NC,L] Basically it redirects URLs ...
-1
votes
1answer
99 views

“Simple” .htaccess rewrite for sites in subfolders not working [duplicate]

I have a catch-all Apache virtual host in /var/www/. In it, I have a index.php that handles all the code for pages, and subfolders holding the resources for each site (images, css, etc). I want a ...
1
vote
1answer
185 views

php htaccess environment variables php-fpm mod_proxy_fcgi apache 2.4

My .htaccess: SetEnv tvar "my value" RewriteEngine on RewriteRule .* - [E=boostpath:normal] My virtual host settings: AllowOverride All Options FollowSymLinks Require all granted ...
0
votes
0answers
78 views

.htaccess rules for accessing subdirectory as document root

I'm using Magento on a LAMP stack. I have my primary store/application accessible from the root directory (e.g. website.com/). I have created a custom form for processing 3rd party vouchers at ...
0
votes
1answer
80 views

301 Redirect Root and Only Root (“/”) from https to http

I have found several Q/As on how to redirect root only, how to redirect from https to http (using .htaccess). But there was no question that merged both. And this answer is too dirty: ...
0
votes
1answer
97 views

htaccess conditional redirect to https

So i'm trying to redirect to https all visitors except my internal networks 192.168.x and 10.x RewriteCond %{HTTPS} off RewriteCond %{REMOTE_ADDR} !=(192\.168\.$|10\.$) RewriteRule (.*) ...
0
votes
1answer
33 views

Restrict access to entire website except the homepage using .htacess

I have just put a website live, but I need to restrict access to everything except the homepage for users outside of my IP address. I would like to do this using .htaccess. So far I have come up ...
0
votes
0answers
78 views

Apache Gzip not compressing js files

I have enabled Gzip compression via adding the below to my .htaccess file: <ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ ...
-1
votes
1answer
67 views

Tomcat app behind Apache, htaccess auth

Please help to set up a protection for Tomcat app with .htaccess. I want to use mod_proxy ProxyPass and ProxyPassReverse My tomcat app: www.example.com:8085 What I want is to make it impossible to ...
1
vote
0answers
15 views

.htaccess not working inside a firewall or proxy

I have a test site running with an .htaccess file defined like so: AuthName "test" AuthUserFile "/home/testdomain/.htpasswds/public_html/passwd" AuthType Basic require valid-user This requires a ...
2
votes
1answer
246 views

Nginx rewite rules 403 error

I am having trouble with converting .htaccess files to nginx. I have 3 .htaccess files. The first .htaccess file is located in the document root and is as follows: Options +FollowSymLinks ...
0
votes
1answer
48 views

nginx .htaccess in two diffrent folders

I have a script that has 2 .htaccess files. The fist .htaccess file is in the root directory, and the second is in a folder under the root directory called upload. However, what I can not figure out ...
0
votes
0answers
30 views

How to cache particular file in folder using .htaccess

i tried google and found one solution at 'http://webmasters.stackexchange.com/questions/24881/cache-a-particular-image-using-htaccess' but it cache all the file of folder, i want to cache only ...
2
votes
3answers
154 views

nginx [emerg] unknown “0” variable

I've been trying for two days to convert an .htaccess to nginx rewrite the original file looked like this: # Turn on URL rewriting RewriteEngine On RewriteBase // # Protect hidden files from being ...
0
votes
1answer
84 views

RewriteRule not working properly in my ubuntu server 14.04 running in Windows Azure

In my server I kept signup.php and in htaccess I kept this thing - RewriteRule ^registration/$ signup.php [nc] However it's working fine in my Windows machine running Wamp. But not ...
0
votes
1answer
18 views

Alter RewriteRule to change parameter results

Here is my Apache 2 Directory configuration: <Directory /var/www/html/website/> Options +SymLinksIfOwnerMatch RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f ...
1
vote
1answer
300 views

htaccess redirect whole url as parameter

We have created an iframe loader index5.php which will show two iframes, iframe1 and iframe2. The content of iframe2 can be set by accessing index5.php?url=iframe2url. So, going to ...
0
votes
1answer
190 views

Configuring .htaccess on a site with a CodeIgniter app and traq issue tracker

I have this site running on CodeIgniter and I have installed traq for issue tracking. Under public_html I have my application and system directory as well as an assets directory, and also traq. i.e.: ...
0
votes
0answers
73 views

Cache-Control only working for media files and not static files served in Django

I'm trying to use Cache-Control for my static files. Following is my code for the .htaccess file # 1 YEAR <FilesMatch "\.(ico|svg|woff|eot|ttf)$"> Header set Cache-Control "max-age=31536000, ...
2
votes
1answer
192 views

Apache, htaccess, url rewrite

I have .htaccess file I'm using for testing, here is my file: RewriteEngine On RewriteCond %{REQUEST_URI} ^/([a-z-]+)/?$ [NC] RewriteRule ^ %{REQUEST_SCHEME}://%{SERVER_NAME}/?title=%1 [L] I'm ...
0
votes
1answer
659 views

.htaccess not being loaded in Ubuntu 14.04 (Apache 2.4.7)

I'm trying to use the .htaccess file in Ubuntu 14.04 (Apache 2.4.7). Here is what my .htaccess looks like # 1 YEAR <FilesMatch "\.(ico|svg|woff|eot|ttf)$"> Header set Cache-Control ...
0
votes
1answer
27 views

static files from subdomain, fcgi from root

I would like to send requests for foo.com -> foo.com/dispatch.fcgi and requests for a subdomain bar.foo.com -> foo.com/bar I have this in my .htaccess file; AddHandler fcgid-script .fcgi ...
0
votes
2answers
101 views

SetEnvIfNoCase Host: .htaccess to web.config conversion

I have tried IIS Manager and some online conversion tools but I can't figure out how to achieve the following .htaccess rules in a web.config file: SetEnvIfNoCase Host my-domain.com nopassreq ...
0
votes
1answer
20 views

Lighttpd: How to migrate a rewrite rule?

i'm using this htaccess rule on a apache: RewriteEngine on RewriteCond %{HTTP_REFERER} example\.com [NC] RewriteRule .* - [F] .. and i would convert it to an lighttpd rewrite rule. How can i do ...
0
votes
1answer
645 views

.htaccess file causes “500 Internal Server Error” but no error log entry

I set up an apache manually and added a second web directory with this code: Alias /webs c:\webs <Directory /webs> AllowOverride All </Directory> However, this web has an .htaccess ...
-2
votes
1answer
181 views

Apache Redirect to another folder, both within and outside document root [closed]

I've recently set up a home web/media server and having a few difficulties with a few of the settings. It's working fine for serving webpages etc but I've now reorganised the structure of the main ...
0
votes
3answers
116 views

Deny connection to and from a specific hostname on Ubuntu/Apache2

My wordpress EC2 server was probably hacked. When running iftop command I can see that my server sends and recieves data from a hostname name "i157panamamails.com". This hostname never goes away and ...
-1
votes
2answers
71 views

.htaccess file isn't working for https

I have simple .htaccess file to forbid access to a directory as : order allow,deny deny from all Well, it doesn't work with SSL and show the content of directory if client access the directory ...
-5
votes
1answer
41 views

Configure subdomain godaddy and use an existing CERT [closed]

I just created a subdomain ony my domain named: profile.cv.hsoto.me However, when I try to access it, I get a warning: I'm not sure how to fix this. My .htaccess file is as follows: # BEGIN ...
0
votes
2answers
55 views

Apache: Stealth 404 the admin area until authenticated via basic auth, then allow access

Given a administrative area with urls like this: wp-admin/ wp-admin/whatever wp-admin/another-page wp-adminsecretlogin A standard basic-auth coverage would provide a username and password prompt on ...
0
votes
0answers
36 views

Show 404 page with redirecting to www only

I want to change the 404 error. What I did is redirecting the 404 error page to a custom one, without redirecting the URL itself. This works perfect (http://www.gincher.net/not.exist)! I'm using ...
-2
votes
1answer
28 views

mod_rewrite redirect any domain except principal domain to the principal domain [duplicate]

I have some rules as follows: RewriteCond %{HTTP_HOST} ^domain.com RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L] I would like to make the rewrite condition match ANY domain OTHER than ...
0
votes
1answer
122 views

.htaccess is not working on Zend server on Windows

I am a beginner to MVC framework in PHP and also to .htaccess file. I use Zend server on Windows OS. My code in .htaccess is: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -d RewriteCond ...
0
votes
2answers
435 views

where to put wordpress htaccess on openshift

I have cloned my wordpress application from openshift with git, in my cloned application there is php folder, when i put my htaccess file in it then i commit my changes like this : git add -A git ...
0
votes
1answer
57 views

htaccess password multiple password same user [closed]

How to assign multiple passwords to the same user in .htaccess password protection? It looks like this in my .pass file, but only the first one is working christina:o5hZ6Uplugq.2 ...
1
vote
1answer
77 views

apache expires not working for pyramid server

I have a pyramid server running on EC2 via apache with following configuration - <Directory path_to_virtual_env> WSGIProcessGroup pyramid Require all granted Order allow,deny ...
1
vote
0answers
178 views

blocking referring domain and all of its subdomains via rewrites in htaccess

I'm looking to block two referrers along with all of their subdomains. When using this in my htaccess, they're not getting a 403, but instead a 500 response from apache (complaining about too many ...
0
votes
0answers
117 views

Apache Alias on multiple vhosts + redirect rules

I'm facing a tricky problem and I have problems to solve it through Apache config. I have two vHosts on my machine: A) /var/www/front/web app.domain.ext B) /var/www/api/web api.domain.ext This ...
1
vote
2answers
974 views

Invalid command 'AuthType', perhaps misspelled or defined by a module not included in the server configuration

I'm trying to password protect the document root and all I get is an "internal server error" page. The Apache error log shows: Invalid command 'AuthType', perhaps misspelled or defined by a module ...
0
votes
1answer
226 views

htpasswd - Any tip to block brute force attacks?

Update: As Craig suggested I'm trying fail2ban now. Even though I have issues in that as well. failregex is not finding any result though. I had enabled all apache* in jail.local and here is how my ...
0
votes
1answer
86 views

Conveting .htaccess to Ngix rules

I need to convert htaccess file to nginx config. I http://winginx.com/en/htaccess but an error occurred when I update the nginx config file. The htaccess file reads: DirectoryIndex index.php ...
-1
votes
2answers
366 views

Autodiscover URL redirection from cPanel Apache to different Subdomain URL on an IIS/Exchange server

== The Current Situation: == We have a web and DNS server for contoso.com (10.10.10.1) This web server 10.10.10.1 is also the mail server for @fubar.contoso.com We then have another server for MS ...
0
votes
1answer
323 views

mod_expires doesn't set expiry for images (png,jpeg,gif)

I am using this below configuration in my apache2.conf <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/gif "access plus 6 month" ExpiresByType image/jpg "access plus 6 ...
0
votes
1answer
437 views

htaccess and rewrite - Internal redirect within Alias

I have the following .htaccess within a subdirectory: RewriteEngine on RewriteRule ^file.js$ file.php This works by internally redirecting the request to the PHP file, with the same name, which is ...
0
votes
1answer
61 views

can htaccess file define different RewriteBase for production and dev servers

I have htaccess files that use different RewriteBase on production and dev (windows) pc. Currently I change the RewriteBase manually when deploying. Can this be done automatically with some ...
1
vote
1answer
127 views

Why can't I redirect url's with “index.html” in it to a php file?

I'm stuck in a big problem, but let me start with one part of it. I am wodering why this works: RewriteRule ^(.*)index.html $1 [R=301,L] while this doesn't: RewriteCond %{REQUEST_FILENAME} ...
0
votes
0answers
91 views

Multiple Rewrite rules not working in htaccess file (mod_rewrite)

Can anyone help me how to write multiple rewrite rules in htaccess file. In my condition I want to remove index.php from url and also want to use file based cache busting, I am using following code in ...
0
votes
0answers
27 views

How to allow access to the site root document in htaccess?

What I am trying to accomplish looks quite simple: allow the site's index.html for everybody and hide everything else from everybody. Needless to say the index.html file can be addressed as ...
-2
votes
1answer
48 views

Redirect entire site to URL with 302 - All URLs to 1 URL [duplicate]

What i want to do is redirect an entire forum temporarily to a Twitter Page. However anything i've tried hasnt worked. If they visit for example site.com/Forum it will send them to ...