Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
58 views

How do you exlcude a sub-directory from an Apache rewrite ruleset?

I have a multilingual site with the root being English and a sub-directory (/es/) being a human translation into Spanish. Instead of manually updating all URLs, I have a opted to use mod_rewrite to ...
1
vote
1answer
304 views

How to enable compression with mod_deflate

Page speed insights tells me to enable compression for google-maps source. It recommends to use mod_deflate if using Apache. Well, I've put the next snippet code inside the .htaccess file: ...
1
vote
0answers
101 views

htaccess, errordocument and joomla rewrite

I need to setup a 404 error handling in my .htaccess, besides handling some 301 redirects for the links of an old website. The new site is made with Joomla, the old site was written in asp. Sef urls ...
0
votes
1answer
124 views

Redirecting www.subdomain.domain.com to domain.com with htaccess

So I'm trying to get my server configured in a specific way so that anyone who visits http://www.subdomain.domain.com or https://www.subdomain.domain.com gets redirected to https:// without the www. ...
0
votes
0answers
90 views

How to overwrite .htaccess rewriterule

I have the following folder and .htaccess structure on my server: public_html/.htaccess # Use PHP5.3 Single php.ini as default AddHandler application/x-httpd-php53s .php Options -Indexes # Start ...
0
votes
1answer
42 views

New rule to .htaccess file don't work on live site

I had to add a rule to the .htaccess file of existing site, which redirect some old images urls to the new ones. So, directly after the RewriteEngine On I added my new rule: RewriteRule ...
0
votes
1answer
338 views

How can I setup an IP whitelist for a subdirectory?

A client of mine complained of an attack. I checked the access log and found a massive number of requests for the admin login page from seemingly random IP addresses. I created an .htacces file in the ...
0
votes
1answer
34 views

Apache2: serve page from another IP address

Please bear with me while I try to explain some htaccess gymnastics I'd like to perform... I have the following domain: eamorr.somesite.com (192.168.100.100) It is serving pages from my ...
0
votes
2answers
110 views

Denying access via .htaccess according to referrer

I'm trying to block access to my website depending on whether a visitor had visited the site through another website. The latter has been using up my traffic by using an iframe to display content ...
1
vote
0answers
68 views

AuthType Digest Realm Password White Space Issue

I have an issue where I am trying to set a test directory to authenticate using the AuthType Digest. I have been able to successfully complete this but only when the AuthName of .htaccess is one ...
0
votes
1answer
65 views

What is wrong with my httpd.conf file?

I am using Apache 2.2.22 on Ubuntu 12.04 with PHP 5.3.10. The real domain name has been obfuscated to example.com for this question. I am attempting to set AllowOverride to None. I currently have an ...
0
votes
1answer
77 views

A subdomain not loading

On my newserver i set up a subdomain patientslife.linf.in. But when i try to set up another subdomain pmr.linf.in it shows the page The connection was reset in Mozilla and No data received in chrome. ...
1
vote
1answer
42 views

file-name is transparently redirecting to file-name.php

If I request /file-name I get /file-name.php's content back. I want to know how this is happening but can't seem to figure it out. I emptied the .htaccess and it's still doing it. I verified that the ...
3
votes
2answers
722 views

Apache basic auth for a particular URL

I have a site in production that I want to modify (translate from French to English). The modified part will be placed in the domain.com/en URL location and I want to protect only this part with a ...
0
votes
1answer
41 views

add word in url using .httaccess

Right now i am accessing abc.xml from test directory as below http://localhost/test/abc.xml I want to redirect the above url as below http://localhost/test/test.php?abc.xml ...
1
vote
1answer
69 views

Restrict non whitelisted IP's from viewing Directory list in Apache

I am trying to restrict access to viewing Directory Indexes or viewing lists of files in a directory unless your IP is in a whitelist. I am using Apache web server and an .htaccess file. So here is ...
1
vote
2answers
568 views

Apache httpd: How can I Deny from all, Allow from specifc IP addresses

Can someone take a look at the syntax of the code below and let me know if it is correct -- my intention is to exclude the htaccess for the IP ranges specified in the 'Allow' part and rest of all ...
4
votes
1answer
152 views

Htaccess application/type with PHP as FastCGI

Is there a way to use .htaccess with PHP as CGI/FastCGI? I would like to be able to have other extensions open as PHP. I have tried the following: AddType application/fcgid-script .phpd AddHandler ...
1
vote
2answers
65 views

htaccess with multiple parameters

RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !\.php$ RewriteRule ^(.*)/(.*)/(.*)$ $1.php?Action=$2&id=$3 RewriteRule ...
0
votes
0answers
141 views

WP in subdirectory : redirect loop error due to htaccess?

I have a fresh Wordpress install in a subdirectory: /blog/ I visit my Wordpress site like this: http://www.example.com/blog and posts like this: http://www.example.com/blog/category/postname In ...
1
vote
1answer
3k views

Apache .htaccess <ifModule not allowed here

Running Apache on Ubuntu Precise, with PHP 5.5 Trying to access my var/www/ gives me a 500. /var/log/apache2/error.log shows: /var/www/web/.htaccess: <IfModule not allowed here my .htacess is ...
0
votes
0answers
34 views

htaccess redirect issue in subdomain and subdirectory back to root

I am having a little issue in a 301 redirect. i have a subdomain which can be accessed from directory url as well. i put a 301 redirect as Redirect 301 /subdirectory/ ...
0
votes
1answer
31 views

Inspecting apache mod_rewrite

I want to do something simple with apache mod_rewrite. And guess what, it doesn't work. Had I been in a "sane" environment, maybe I would get an error and a stack trace. Or maybe I could use a ...
0
votes
0answers
45 views

unidentified redirect based on the referer

My client has a problem with a redirect. When there's an external link pointing to his website, this link gets redirected by the server back to the referer. $ curl -i -H "Referer: ...
1
vote
0answers
30 views

htaccess is not redirecting in server

I'm having problem with a .htaccess file removing request.php from URL. My htaccess file is <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
0
votes
2answers
3k views

Removing php extension with .htaccess does not work

I use the following code on my site elixnews.com to remove php extension from: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
1
vote
1answer
104 views

How do I get Apache2 to parse (without error) Header directives in a .htaccess?

I am getting pages loading with a 500 internal server error, due I believe to a directive that Apache has not been configured to allow. I have AllowOverride set to all, and a .htaccess file, ...
0
votes
1answer
104 views

.htaccess URL rewrite to upper-case characters in domain

For example, I'd like to have foobar.com show FooBar.com This almost works, but ends up forcing a redirect loop: RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?foobar.com\.com RewriteRule ^(.*)$ ...
0
votes
1answer
14 views

.htaccess need to redirect direct calls to newdoamin and rest to index.php?var

I just moved my old site to a new URL but still using the old one to hosting files and other few stuffs. I want to redirect user to http://newdomain.com if the URL is http://olddomain.com but if the ...
0
votes
1answer
71 views

Makes Apache2 aliased directory takes parent's .htaccess file into account

I have an Apache 2.2 VirtualHost where DocumentRoot points to /var/www/mysite.com directory. I also have Alias to make some pages/scripts located in /var/www/stuff easily available (to others ...
0
votes
0answers
113 views

Apache .htaccess security and wp-login.php

Lately we had a lot of requests to our wp-login.php on one of our wordpress installations. So after reading up a little, I decided to allow access only to the two static IPs we use in the office, ...
0
votes
1answer
45 views

URL Rewrite http to https with www

I have a domain with several apps. All apps should be reached like this. https://www.website.com/app1/ https://www.website.com/app2/ https://www.website.com/app3/ The problem I'm having is with my ...
1
vote
0answers
80 views

RewriteCond if folder with parametername exists

I want to make a subdomain-redirect if a folder with the same name as the typed subdomain exists. e.g. I have some folder-structure like www.mysite.de/mainpage/hui.php and want to be able to access it ...
0
votes
0answers
58 views

Redirect to HTTPS and back with .htaccess on specific pages

I'm trying to use rewrite rules to redirect to HTTPS on specific pages, and back to HTTP on all the other pages. The pages that needs to be redirect are those who have the following in the URL: ...
0
votes
2answers
2k views

Redirect all http AND https non-www URLS to https://www.example.com via htaccess

For reasons much too long and complex to get into (it involves several layers of corporate red tape resulting in someone else not purchasing a wildcard SSL certificate I requested), I have to set up a ...
0
votes
1answer
153 views

Using mod_expires conditionally depending on an environment variable

I've borrowed some mod_expires code from the HTML5 Boilerplate that adds some sensible defaults for asset expiry (I have filename version revving configured with htaccess so I can add mtimes before ...
1
vote
1answer
18 views

.htaccess domain directory does not resolve domain.com/domain properly

I have 2 domains that point to the same IP foo.com and bar.com I don't have access to setting up a virtual host for the domains but I have managed to create .htaccess rules so that it is setup like ...
-1
votes
1answer
74 views

off php engine and htaccess using regex in apache

I have some sites on a server. they all have a drectory named 'image-upload' where users of sites upload their images. I want to: Off PHP engine for this directory on all the sites disable ...
0
votes
0answers
31 views

Ignore a subdomain with .htaccess

In the root of my top domain i got a Wordpress multi site install. It's a testing server so i would like to add some repo in it to show/test my code. The problem is, when i add a repo in my / ...
1
vote
2answers
233 views

redirect all .txt files at the root dir to 404 (Except robots.txt)

I'm trying to configure my .htaccess to redirect all txt files at the root dir to 404 Error. (Except robots.txt) I tried using RedirectMatch 404 [^robots]\.txt$ But it redirects also txt files on my ...
1
vote
1answer
73 views

How to force a subdomain as a default domain but keep other subdomains working?

I have a WordPress site installed at http://www.example.com and another testing WordPress site at http://test.example.com. I've successfully made http://www.example.com redirect to ...
1
vote
1answer
366 views

Configuring htaccess file for self hosted CDN

I am trying to set up a self hosted cdn for my site, but I am having problems with the rules in the htaccess file and I can't get it to work. At the moment the ftp server that will act as CDN has the ...
0
votes
0answers
102 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, ...
0
votes
1answer
16 views

Issue with mod rewites in htaccess on Apache

I am using a private host, linux php, where the htaccess just does not act like it does with the bigger famous top 10 hosts etc. redirect 301 /pagea.html /pageb.html Causes a 500 internal error on ...
1
vote
0answers
25 views

How do I write this .htaccess rule?

I'm having trouble constructing a RewriteRule in .htaccess to redirect http://edgerank.net/%22%20%5Cl%20%22What-is-EdgeRank to the root of the domain I think the issue is that I'm not escaping ...
0
votes
3answers
45 views

RewriteRule doesnt work

I want to convert this url http://ts.thebenamorgroup.com/g2g/category.php?cate=mens to: http://ts.thebenamorgroup.com/g2g/category/cate/mens/ I have this rule but it doesnt work: Options ...
0
votes
1answer
214 views

Looking to generate a directory exception to .htpasswd SSL-protected site

I have an entire site under .htpasswd with SSL - any http requests are rejected - and am trying to exempt a folder from the rule. Either to do a basic .htpasswd for the directory, or make it open. I'm ...
-1
votes
1answer
51 views

https version of website being redirected to some random website [closed]

My website http://www.scoredragon.com/, when accessed with https i.e (https://www.scoredragon.com/) instead of http is being redirected to book-your-driving-test-online.co.uk. I have searched for the ...
0
votes
1answer
19 views

.htaccess ONLY for directory not for the files in them

I have a .htaccess file: <limit GET> order deny,allow deny from all allow from 123.456.789 </limit> ErrorDocument 403 /403.shtml However, this affects the entire directory and the ...
-1
votes
1answer
23 views

Difference b/w .htaccess and example.com.conf

I have a example.com.conf and .htaccess for example.com site. When I place this following content in .htacess file RewriteEngine on # if a directory or a file exists, use it directly RewriteCond ...