Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

2
votes
1answer
27 views

Something like foreach in htaccesss?

I am in this situation: url: domain/var1/var2/var3/.../varn And I want to change that url in: url: domain?v1=var1&v2=var2&v3=var3/.../&vn=varn I found this way: RewriteRule domain/([...
0
votes
1answer
23 views

Dreamhost VPS Apache 2.2

This is a very unusual problem to begin with. Most people are having trouble with the .htaccess where they accidentally are denying permissions and want to fix that. I have the opposite problem. I ...
0
votes
0answers
16 views

.htaccess syntax RewriteEngine on

I'm learning to maintain my own WP site. After a lot of reading I ended up with my "complete" htaccess file that looks something like this DirectoryIndex index.php # Disable directory listings ...
0
votes
1answer
38 views

Is it possible to conditionally set php_value in .htaccess

I want to set php_value (error_log) based on the host server. If it is a local server: php_value error_log ./PHP_errors.log and if it is the remote server: php_value error_log /home/user_id/...
0
votes
0answers
22 views

Excluding a file from an IP block

I have recently converted a pre-2.4 configuration to Apache's new authorisation configuration but ran into a problem/misunderstanding concerning more than one RequireAll block. What I am basically ...
0
votes
0answers
22 views

RequireAll blocks overriding each other [duplicate]

I have recently converted a pre-2.4 configuration to Apache's new authorisation configuration but ran into a problem/misunderstanding concerning more than one RequireAll block. What I am basically ...
1
vote
0answers
12 views

How to provide read access to a folder and its files via htaccess

This is probably trivially easy but after RTFM'ing and trying several things I seem to be a bit stuck... The current version "appears" to let me access the directory BUT NOT the files via the browser....
1
vote
1answer
89 views

Disable https for a single file in apache

For a long time, I didn't use https on my linux server because I didn't find a decent CA that suits my needs. Now, Let's Encrypt (a new CA that provides free certificates) has launched their open beta ...
1
vote
1answer
83 views

apache httpd mod_expires does not work when deflate is on

On a Debian Jessie installation, I manually installed wordpress and edited .htaccess, turning mod_expires on: ExpiresActive On ExpiresDefault modification However, when I use Firefox Inspector to ...
0
votes
0answers
21 views

Strange bug with htaccess

I have a website installed on "/aaa/bbb/ccc/index.php". I created a file "/aaa/bbb/ccc/.htaccess" with only this content below and nothing else: RewriteEngine on After that I created a file "/aaa/...
2
votes
1answer
157 views

Laravel and Wordpress on same server/domain

I am trying to host a WordPress site inside a Laravel(5.1) project. I have the following structure (stripped down some) ├── app ├── config ├── public │   ├── index.php │   ├── wordpress -> ../...
0
votes
2answers
43 views

.htaccess rule to 301 redirect /?my_foo=bar to /foo/bar/

I tried, unsuccessfully, for hours to build (what I think is) a simple 301 redirect in an htaccess file. My url looks like this: www.example.com/?my_foo=bar And I want it to 301 redirect to: www....
0
votes
1answer
112 views

How to prevent opening /index.php or /index.html urls?

DirectoryIndex index.html index.php # -- INIT RewriteEngine on RewriteBase / # -- PRODUCTION # RewriteCond %{HTTP_HOST} ^www.assist\.loc$ [NC] # RewriteRule ^(.*)$ http://assist.loc/$1 [R=301,L] # -...
0
votes
0answers
21 views

Why is my redirect not working?

I have noticed a problem on a website that I manage. It is currently setup to redirect https://www.domainA.com to https://www.domainB.com This appears to be working but a similar redirect from http://...
0
votes
1answer
73 views

Apache's SetEnvIf to another variable in .htaccess

Is it possible using SetEnvIf to set a variable to the content of another variable? and if so, how? For example SetEnvIf defined_htaccess_var ^(.*)$ has_been_defined=%{defined_htaccess_var} So the ...
0
votes
2answers
74 views

htaccess protection of directory does not work any longer?

unfortunately the protection of my wp-login.php does not work any longer: <Files wp-login.php> AuthName "Forbidden access" Require ip 1xx.xxx.xx.x/24 </Files> This is apache's ...
2
votes
1answer
70 views

SuppressDescription Removes All Columns but the Name

I'm using mod_autoindex for some time with success (fancy index). However since I see no use for my "Description" column, I thought I'd remove it. According to the documentation, ...
1
vote
1answer
55 views

.htaccess commands are case insensitive?

I see the same .htaccess code snippet written with two different ways as follows: <Files .htaccess> order allow,deny deny from all </Files> and <Files .htaccess> Order Allow,...
0
votes
1answer
60 views

Force http on single page with site wide https is in place

On my website, I have one page that loads content in iframe form other sources and hence cannot have an http connection. I have an SSL installed and have a site wide https forced on all urls. I am ...
0
votes
0answers
26 views

problematic htaccess remapping of old domain urls to custom pages on new domain

I am remapping a bunch of urls from old domains to custom pages on the new domain, and a handful of rewrites for old urls don't seem to be applying. These are the rules i have now for the domain ...
1
vote
1answer
1k views

Redirecting based on URL via .htaccess

I saw this: http://serverfault.com/questions/58762/how-to-redirect-root-and-only-root-via-htaccess and it's close, but not quite. I am in the middle of rewriting a site, and would like to be able to ...
0
votes
1answer
3k 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 month"...
-1
votes
1answer
88 views

how should i exclude certain .php URLs from being loaded through SSL?

recently i activated flexible SSL on my wordpress website,but i wish to load certain .php URLs through simple http, ones like: thankyou.php and contact.php ,and a few others, what code should i add to ...
0
votes
1answer
32 views

.htaccess Set custom variables

Is there a way to set custom variables inside my .htaccess files so I could use them later in my .htaccess code ? For example, I have a redirection to 2 different servers. Can I store the servers ...
1
vote
1answer
51 views

Apache rewrite rule to iis

I am trying to move site on apache to iis 8.5 All is ok, but 1 rule failes my site to run properly RewriteCond %{REQUEST_URI} !\.(js|css|jpg|jpeg|gif|png)$ [or] RewriteCond %{REQUEST_URI} apple-...
1
vote
1answer
33 views

manage ip access control through httpd php app with virtual_host configuration

Problem The system is allowing universal access to the php app 'owncloud'. That is, access is granted to servers across the network. As a test 'Require all denied' did not control access. What is ...
0
votes
1answer
192 views

PHP cache control

I have recently started some cache control on my website and it seems like some of the functions have stopped working because of this. My PHP content doesn't update anymore. In the Chrome network tool,...
0
votes
1answer
16 views

How do I prevent RewriteRules conflicting

I have three RewriteRules I am trying to implement but I cannot get all 3 to work together: RewriteRule ^products$ http://%{SERVER_NAME}/en_ca/products [L,R=301] RewriteRule ^products/(.*)$ http://%{...
0
votes
2answers
2k views

.htaccess Authentication Internal Server Error 500

I am trying to setup an authentication for a directory on a ubuntu server and when i sign in i get a 500 Internal Server Error I have the following: AuthUserFile .htpasswd AuthName "Sign In" ...
1
vote
2answers
63 views

.htaccess deny/allow rules denying folder, but not direct to files

We have a .htaccess file in a folder configured with deny,allow as follows: Order deny,allow Deny from all Allow from <whitelist IP> Allow from <whitelist IP> .... There are no other ...
1
vote
0answers
42 views

Nginx htpasswd getting 403 after successful login

I want to access the folder /folder/subfolder/ in the webservers root (/var/www/dl.somewebsite.com/files/) with a password the rest should be public accessible. Using the script below I get a 403 ...
1
vote
1answer
46 views

Redirect page to 410 if match a specific Regex in .htacces

First time using .htaccess so I come here to have a bit of help since the web is not that file with informations (or I just don't find them :/). So the idea is that I want to redirect link ending by /...
2
votes
1answer
90 views

htaccess - redirect based on the request origin

Please help me out here. I would like to use .htaccess to redirect based on request origin, for example: User requests: http://www.domain.com/subfolder/ And should be redirected to: http://www....
1
vote
1answer
38 views

How to enable Apache DIGEST Authentivation everywhere on files and subdirectories

I'm trying many different configurations following many tutorials and documentations, I can't get the authentication without creating thousands .htaccess files. Here is my configuration : <...
2
votes
2answers
47 views

Can't redirect https for http

Some versions of Chrome automatically add https to my site addres. So I need to redirect https to http, because I don't have SSL certificate. I'm trying this, with no result: <IfModule mod_rewrite....
1
vote
2answers
225 views

block fake google bots [duplicate]

How could I block DDOS attacks with fake Google bots? I found 2 solutions on the net. But both seems to block also correct google bots. # Block fake google when it's not coming from their IP range's ...
0
votes
1answer
956 views

Apache: Request exceeded the limit of 10 internal redirects due to probable configuration error - WooCommerce

I have a woocommerce site. I have a recursive error in the Apache error.log: [Mon Nov 02 17:04:58.723578 2015] [core:error] [pid 2922] [client 172.31.12.207:19044] AH00124: Request exceeded the limit ...
1
vote
0answers
11 views

Turning off Hostnamelookup in shared hosting [closed]

I have a linux shared hosting account with cpanel for a drupal website. While optimizing the site (with the help of information from tools.pingdom.com), I found considerable waiting time of about 400-...
0
votes
1answer
52 views

How to replace %E2%80%8E with slash (/) using .htaccess?

Following image is my hosting directory, .htaccess locations and more explanation. Please kindly have a look. Image is here >>> my hosting and sites directories Problem: Somebody link to my blog and ...
0
votes
1answer
27 views

Load images from a different domain with htaccess?

Can I load images from a different domain with an htaccess file? So if my HTML as this: <img src="www.site.com/img" /> Can I make it be as if the HTML was: <img src="www.site2.com/img" /&...
0
votes
1answer
22 views

Can i use one .htpasswd file for different folders on Linux server

I have many modules in my codeignitor application as module/products module/billing module/cms module/groups ..... Some of the above modules are accessible to admin user only so I want to put ....
-1
votes
2answers
23 views

Rewrite domain to cut its URI [duplicate]

I need to set up the domain.com/wp1/ to be shown like domain.com/ I have tried to set up any rewrite in the past hours, but no success :( P.S. There is a wordpress installed in the public_html/wp1, ...
-1
votes
1answer
35 views

RewriteRule running after Require test failed which rewrites 403.shtml to website content instead of error message

When a request gets denied due to require all denied, it first gets routed to the ErrorDocument 403.shtml but then that gets rewritten rather than stopping there and the site content actually gets ...
1
vote
0answers
21 views

Make Varnish check for html static before serving

I was thinking of writing some logics to my application so that it can write the static page content to s3 or some CDN and serve primarily from there. But am not sure if this is possible. For ...
0
votes
0answers
59 views

mod_rewrite hide URL params

I have the following URL: www.mydomain.com/musician.php?musician=musicianname&id=idnumber I am using mod_rewrite to achieve this: www.mydomain.com/musician/musicianname/idnumber This is the rule ...
1
vote
0answers
126 views

Nginx, redirect all resquest to single index.php file in subfolder

I'm trying to move my website from Apache to Nginx. My website is structured like this : www_root public other folders All requests are redirected from www_root to public folder with an ....
0
votes
4answers
834 views

point multiple domain to single web hosting account

point multiple domain to single web hosting account using htaccess i have used the following .htaccess file in my public_html directory RewriteEngine on RewriteCond %{HTTP_HOST} ^site1.org$ [OR] ...
3
votes
3answers
1k views

.htaccess per directory in nginx

I am new to nginx and I have been on apache before. In apache, each directory can have a .htaccess to target the directory and and it's subdirectories. Is this possible for nginx? If so, how do I do ...
0
votes
0answers
89 views

Convert .htaccess rule to the correct Nginx one

Good day, I've just installed a simple url shortener script on my website, unfortunately the author is not able to give me advice for Nginx since he wrote the script with Apache and mod_rewrite in ...
11
votes
2answers
7k 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, ...