Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
7 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
36 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
14 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
26 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
21 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
9 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
21 views

amazon ec2 - opencart seo url not working [on hold]

I am new to amazon ec2 and opencart. I am trying to enable seo urls in opencart. I enabled it from settings/Server and set seo keywords in products. I didnt have .htaccess file so put had to upload it ...
-1
votes
0answers
21 views

How to improve cross domain page loading [closed]

I am on a LAMP stack with multiple domains and a cPanel back end. I have a domain, www.domainA.com which will eventually be one of numerous domains A-E (not literally A-E, but you get the idea), all ...
2
votes
1answer
25 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
39 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
34 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
29 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
24 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
25 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
24 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
7 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
30 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
32 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
32 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
0answers
18 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
25 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 ...
-1
votes
0answers
44 views

Block Aggressive/Incoherent Bot? [duplicate]

I have a weird bot pummeling my site. It COULD be some sort of low-level denial-of-service attack, but I think that's unlikely. More likely script kiddies. I'm looking for suggestions on blocking it ...
0
votes
1answer
37 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
38 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
44 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
16 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
39 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
0answers
27 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
9 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
51 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: ...
-1
votes
1answer
28 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
42 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 : ...
0
votes
0answers
50 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
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
1answer
20 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
48 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 ...
0
votes
0answers
25 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 ...
0
votes
0answers
29 views

Supersede the default Apache config on a different config file

I'm using Ubuntu with Apache 2.4. The config file for Apache is found at /etc/apache2/apache2.conf at the end of this config file it's written # Current File: /etc/apache2/apache2.conf <Directory ...
0
votes
1answer
68 views

Htaccess, allow ip, deny ip and prompt for other

I have a list of ip which doesn't require login prompt ... I have a list of banned ip ( no prompt juste deny access ) But i need a prompt for all others ip ... I tried this : AuthType Basic ...
1
vote
1answer
15 views

URL rewriting a specific directory

I want to rewrite the URL when receiving a request that is not a file and either for directory subdir or not a directory at all. E.g. (!file) && ( (subdir ) | ( !directory ) ) Here's my ...
-2
votes
2answers
183 views

How to set custom $_SERVER variable for PHP

I'm working on a PHP web app which ALSO has some command line tools. I need the command line tools to detect the environment so that they connect with the correct DB credentials etc. The web app does ...
0
votes
1answer
55 views

.htaccess not working on ubuntu 14.04

Here is relevant code from 000-default.conf: <Directory /var/www/html/> AllowOverride All </Directory> But when I put a .htaccess even with nothing in it every site except for the ...
0
votes
1answer
79 views

mod_rewrite in .htaccess and basic auth in vhost - access to paths

I want to lock down a website (made on Drupal) with basic auth. Drupal is using mod_rewrite in its .htaccess file. The problem I'm facing is this - my virtual host looks like this: <VirtualHost ...
1
vote
0answers
10 views

.htaccess redirect keeping url when there is wordpress code involved [duplicate]

I have two domains, alfa.com and beta.com. Beta.com points to alfa.com subdirectory named "ae" by following htaccess-file. It works fine, but what should I add to code to keep beta.com URL and not ...
1
vote
1answer
52 views

How to include local settings in an .htaccess file that is shared between different servers?

I am running a small network of web servers (Apache 2.2/2.4) using essentially the same CGI infrastructure on different machines (and under different domains). The function of each site depends on ...
0
votes
0answers
169 views

wordpress 4.1 force http intp https with .htaccess

I would like to force https with correct Comodo Certificate, in the website www.cabdrome.com with .htaccess (and not only from php). My webserver suggest to use these row to force HTTPS for an entire ...
0
votes
1answer
53 views

Block a unique hash in URL through NGINX

I need to block a hash which is inside a URL through nginx. The URL which requires to be blocked is ht tp:/ /mp3s tri ng.c ...