Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
13 views

Blocking UserAgent libwww-perl with .htaccess not working?

The server is running on Apache, and trying to block libwww-perl, but not sure why it's not working. I've put the following in my .htaccess, but when I run the test I still get the notification that ...
6
votes
3answers
937 views

.htaccess redirect all extension to php

I recently updated my .htaccess file to hide the .php extension of the urls. It works nice, when I try to reach domain.com/index, it displays the php file. When I type domain.com/index.php it ...
2
votes
1answer
3k views

How to exclude a sub-folder from HTaccess RewriteRule

I have WordPress installed in my root directory, for which a RewriteRule is in place. I need to password-protect a subfolder ("blue"), so I set the htaccess in that folder as such. Problem is that ...
2
votes
1answer
902 views

Fully restrict access to sub-directories with .htaccess

With .htaccess, how can I block access to any sub-directories (and its contents) when they are accessed directly (using the browser's address bar for example)? I'm on a shared host, so I do not have ...
1
vote
0answers
6 views

Enable/allow Proxy From Different Server With SSL

I have a node.js app on server A (http://sub.domainA). My customer wants to use this solution without redirecting. The configuration in .htaccess for the node.js service on server A looks like this. ...
0
votes
0answers
18 views

IIS Doesn't Import .htaccess rule correctly

vQmod (virtual file modification system) is a powerful system designed to help developers when they have to edit system core files. The vQmod, by it's nature, help you alter source files without ...
0
votes
2answers
105 views

Multiple custom redirects with apache

I would like to set up multiple redirects using apache but am completely stumped as to how to do it? I have a nodejs instance which serves up my home page running on my server on port 4000. It can ...
2
votes
1answer
881 views

Apache deflate ignores javascript

I have set up deflate in my htaccess. Everything works fine, except for some reason javascript files are being ignored. I tried every possible combination of AddOutputFilterByType DEFLATE with ...
0
votes
1answer
1k views

Apache .htaccess with mod_expires not working for certain directories

I have a Joomla site that I am trying to enable caching using mod_expires. I have the .htaccess in the root of the site and have added the options as found on the page ...
0
votes
2answers
744 views

how to redirect from “https://www.example.com” to be “https://example.com”?

I want to know: How to redirect from .. https://www.example.com to be https://example.com via .htaccess or CPanel? As the SSL only installed on the one without "www", and when I visit the ...
0
votes
1answer
20 views

Block an http referrer on the server level

I am seeing multiple fake http referrers to several sites on my server, which for the most part doesn't bother me, except that they distort visitor stats. I have filtered the questionable domains out ...
-1
votes
0answers
8 views

Redirecting to https gives an error

I recently bought an SSL certificate. When trying to access my website with https://... it works fine. I'm using Codeigniter and want to redirect från http:// to https:// in the .htaccess file. I have ...
-1
votes
1answer
13 views

Godaddy .htaccess and mod_url

I'm an experienced full stack developer and freshly minted webmaster. Recently my client asked me to create a redirect from one url to an outside page. I know how to make a page redirect and I'm ...
0
votes
2answers
910 views

Server, Database or Code Issue? Magento backend rewrites itself with a index.php which doesnt work

I will be honest and admit my cross posting in magento.stackexchange.com but the reason is that I believe it is a server fault, and now I am looking for proof to present to my dreaded hosting ...
0
votes
0answers
24 views

.htaccess multiple rewrite rules .php & .html

I'm pretty new to editing .htaccess and I'm still trying to get a grasp of what to do. I currently have the following code: Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f ...
0
votes
1answer
73 views

How To Force Rewrite and Redirect Url [duplicate]

I have a url: http://domain.com/i.php?c=PT and I Rewrote it to http://domain.com/PT successfully. But When I browse http://domain.com/i.php?c=PT, it wont redirect to http://domain.com/PT. Is there ...
-2
votes
1answer
13 views

How to redirect between Wordpress site using .htaccess if the origin has .html [closed]

How to redirect between Wordpress site using .htaccess if the origin has .html the first site i use permalink .html example: www.domain.com/articles/content.html if i'd like to use 301 redirect to ...
0
votes
2answers
15 views

rewrite www.mysite.com requests to www-staging.mysite.com with .htaccess

I have a staging and production Apache server. To access staging I just go to www-staging.mysite.com/a/sub/directory. To access production, just remove the -staging in the www. Currently, all the ...
0
votes
0answers
37 views

Total DNS errors 100% in openshift

From yesterday suddenly my website down and Google webmaster shows Total DNS errors 100%. My app is http://core-ahang2mail.rhcloud.com I don't know what should I do, Could you please help me? ...
4
votes
1answer
3k views

Error headers: ap_headers_output_filter() after putting cache header in htaccess file

Receiving error: [debug] mod_headers.c(663): headers: ap_headers_output_filter() after I included this within the htaccess file: # 6 DAYS <FilesMatch ...
0
votes
1answer
47 views

Robots file behaviour

I've noticed something odd today. if i go to http://www.google.com/robots.txt, IE11 shows me the contents of google's robot file. However if i go to my site (still in development) using the same ...
1
vote
2answers
6k views

How to redirect example.com from HTTPS to HTTP, then HTTP example.com to newdomain.com?

As of now I use this rule (in .htaccess of example.com) to redirect HTTPS/HTTP example.com to newdomain.com: Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://newdomain.com/$1 ...
0
votes
2answers
14 views

how to write RewriteCond for a url with subdomain

I am trying to ban some bots by writing a RewriteCond rule in htaccess file. Is the following ruleset correct if I add the following: ## block traffic from particular referrers RewriteEngine On ...
1
vote
1answer
24 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
34 views

htaccess deny form all wp-login.php blocks “most” adresses but not all

One of my sites has been hacked recently. To make it short, i had an old version of wisiya newsletters running wich was used to upload a few files in the wp-content directory. Since then a lot of ...
1
vote
1answer
23 views

.htaccess equivalent rules?

To prevent access from other sites (hotlinking) or direct access (typing an URL) are the .htaccess rules below equivalents? RULE 1 <files myfile_one.php> order allow,deny deny from all ...
0
votes
1answer
28 views

htaccess: get request domain for mobile redirect

We have a mobile site that is served using multiple domains. We want to redirect users who are using desktop user agents to our desktop sites while preserving the original domain the user used to ...
0
votes
0answers
164 views

GZip compression won't enable - Works fine on one site but not another

So this is a bit of a weird one... I've had a site hosted on my server for quite a while which has GZip compression enabled in Apache, using htaccess. I recently made a new site on the same server, ...
1
vote
0answers
29 views

Special nginx hotlink protection conversion from Apache .htaccess rule

I have the following anti-leeching rewrite rule in Apache, which i'd like to have in nginx. I see cookie or referrer rule examples. But none combining both, so I am not sure how to go about this. ...
0
votes
1answer
1k views

.htaccess Rewriting Tomcat Server

I am writing a website using Railo. My code is to be deployed on a Railo Server running on Tomcat, overlayed on a regular Apache+PHP server. I need to send all requests to ...
2
votes
2answers
150 views

Apache http to https redirection [duplicate]

I'm using below .htaccess rule to redirect all http requests to https. RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} And it's working ...
0
votes
2answers
25 views

Restrict Location Match by IP via .htaccess

I have a url path defined in rewrite rules ('/admin') which I would like to restrict access to only 1 ip address. I'd image the best way would to use .htaccess rather than coding it in. I've tried ...
2
votes
1answer
33 views

htaccess regex not processing URLs properly

I'm trying to redirect (or 'rewrite') over 3000 urls for a site where we updated the SEF of most of the content pages to remove an ID number that was not needed/desired. This should be a simple ...
0
votes
1answer
22 views

Rewrite rule for specific domain with language (domain.de, domain.com etc.)

I have web application which is accessed via two URLs: domain.com/en/param/param domain.com/de/param/param Is it possible to create a virtual host for a language-specific domain like ...
-1
votes
0answers
26 views

How to implement reverse proxy using .htaccess file

I need to implement reverse proxy using .htaccess for a blog site that is on another server from main site server without changing the main site's url in IIS 7. I have used reverse proxy by Helicon ...
-1
votes
1answer
20 views

can i .htaccess rewrite an url to subfolder if it is one of two alias domains?

two domains point on one and the same webapplication on my server. but when I use the http://domainA.tld it shall point to http://domainB.tld/service but it shall not be a riderict and the address bar ...
0
votes
1answer
44 views

.htaccess file is not working on Apache 2.4.12 and Windows Server 2008 R2

I am trying to add Authentication window to a section of the site using .htaccess file. But It is not working "the site is acting that the ".htaccess" files does not exists. here is that content of ...
-1
votes
0answers
18 views

.htaccess to redirect phone users to different photos folder not working?

I realize there are numerous similar questions. I have checked them and can't figure out where the problem is. I have a large directory of small-for-phones photos ("mobile") using the same ...
1
vote
0answers
23 views

Use custom environment properties from Elastic Beanstalk for htaccess

Is there a way to use the custom environment property of elastic beanstalk in htaccess? I only want to rewrite http to https when not running locally so I thought I could do this by using the ...
1
vote
2answers
2k views

Apache SetEnvIf failing to match Request_Uri

Simple condition, which never match and set variable: SetEnvIf Request_URI "^/path/to/something*" access_granted Checking URI by using PHP is giving correct string, however variable is never set. ...
0
votes
1answer
35 views

mod_rewrite not acting as expected — missing path info

I've just installed a fresh apache (Apache/2.4.7 - Ubuntu) and created and enabled a site with a Document Root of /var/www/html. With mod_rewrite enabled, I proceeded to create a simple .htaccess file ...
0
votes
1answer
1k 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
0answers
23 views

How do I accomplish Drupal “double gzip” prevention in Nginx?

There is this section of the default .htaccess that Drupal ships with: # Serve correct content types, and prevent mod_deflate double gzip. RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1] ...
0
votes
1answer
16 views

Apache AllowOverride Based on Directory

Background Small team(4 people, 2 devs, 1 server admin, director) Three internal applications, one per server. httpd.conf is set to AllowOverride None on / None of our team members are accustomed to ...
4
votes
1answer
2k views

Apache sends plain-text response when accessing SSL-enabled site without HTTPS

I've never encountered something such as this before. I was attempting to simply redirect the page to the HTTPS version if it determined that HTTPS was off, but instead it's displaying an HTML page ...
-2
votes
2answers
34 views

Remove ?m= string from urls

I have urls like site.com/gallery/var/resizes/somename/somename1/somename2.jpg?m=somenumber would like to remove the ?m=somenumber part from urls and simply show ...
0
votes
1answer
13 views

A special rule for a directory in .htaccess

I have this .htaccess file: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?p=$1 [QSA] I'd like to create an ...
1
vote
1answer
120 views

Apache 2.4.9 on Debian 7.8 - .htaccess options not allowed

I’m part the team that administrates a Apache 2.4.9 web server running on Debian 7.8. We’re having an issue with one of our users website: www.example.com/~user When we try to access this URL, a ...
4
votes
1answer
9k views

Why is allow not allowed here in apache2

I've the following in my httpd.conf file: <Directory "/www"> Options Indexes FollowSymLinks AllowOverride AuthConfig FileInfo Options=Indexes,Limit Order allow,deny Allow from ...
0
votes
1answer
1k 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 ...