Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
9 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 ...
1
vote
0answers
25 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. ...
2
votes
2answers
140 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
18 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 ...
0
votes
1answer
18 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 ...
2
votes
1answer
30 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 ...
-1
votes
0answers
23 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 ...
0
votes
1answer
23 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
1answer
19 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 ...
-1
votes
0answers
10 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 ...
0
votes
0answers
13 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 ...
0
votes
1answer
30 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
0answers
21 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 ...
-2
votes
2answers
32 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
88 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 ...
0
votes
0answers
26 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? ...
0
votes
1answer
40 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 ...
0
votes
2answers
12 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 ...
-3
votes
1answer
53 views

Why same request for hundreds times in access log

I don't know what comes to this, and how to prevent it. Look at the time, it keep on with the same request for hundreds times. Not just those particular IPs but some others too. How do I prevent this. ...
1
vote
1answer
28 views

Apache2.4 mod_rewrite won't redirect me to subdir based on visiting domain

I have an Apache2.4 server with public dir in /var/www/html. In that dir I have a Wordpress site with this .htaccess: RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f ...
0
votes
1answer
45 views

Using nginx or mongoose or mongrel or other tiny web server, how to serve certain files from subdirectories as from one root or top level directory

I have a directory structure let's say of /user/me/project1 /usr/me/project1/private/stuff /usr/me/project1/whatever/bla/bla /usr/me/project1/pdf/bla.pdf /user/me/project2 /user/me/project2/priv1 ...
0
votes
1answer
24 views

outlook trying to access image through webdav in email signature

I have an html email signature and 1 image on it which is hosted online. In Outlook 2010 it tries to get this through webdav which at atimes to users can take a while, once it fails then it gets it ...
-1
votes
0answers
12 views

How to show two categories before title in url using .htaccess [duplicate]

In my .htaccess file i am using this line given below to show url like this (http://localhost/mysite/top-5-home-business-in-the-world). "top-5-home-business-in-the-world" is the title. RewriteRule ...
0
votes
0answers
43 views

amazon ec2 - opencart seo url not working

I have installed opencart on my amazon ec2 server. I am trying to activate the seo url feature but it is not working. I have renamed .htaccess.txt to .htaccess in folder directory ...
2
votes
1answer
28 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
2answers
58 views

Redirect loop when forcing HTTPS

I am using the following to force HTTPS on my main website. ### Force SSL RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] If you want to view the full htaccess ...
0
votes
1answer
61 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
56 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
30 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
27 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: ...
0
votes
0answers
26 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} ...
0
votes
0answers
15 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?
0
votes
0answers
10 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
2answers
32 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 .* ...
0
votes
1answer
45 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
34 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 ...
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 ...
-1
votes
1answer
27 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
40 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 ...
-1
votes
1answer
39 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 ...
0
votes
0answers
48 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
59 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
votes
1answer
43 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 ...
2
votes
1answer
32 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 ...
0
votes
0answers
10 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 ...
0
votes
0answers
57 views

mod_rewrite path info postfix and per-dir prefix

There's an issue with .htaccess configuration. I just need the url /category to match the category.php script, but when I try to open this url, there's a 404 error instead. Here's my .htaccess: ...