Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
1answer
21 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 ...
0
votes
1answer
24 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" ...
-1
votes
2answers
22 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
vote
0answers
19 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
54 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
108 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 ...
-1
votes
1answer
32 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
1answer
104 views

Can I use nested <If> directives in .htaccess in Apache 2.4

I am trying to simulate the permalink structure of a previous version of my site using Redirect and RedirectMatch rules in my .htaccess file. I have different rules that I would to apply to different ...
0
votes
0answers
83 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 ...
2
votes
1answer
33 views

How can I override the default Apache HTML directory?

Probably a simple one, but this has me confused. I'm running an EC2 instance which installs Apache 2.2 to the box once provisioned. I don't have access to a2enmod there but I need to change ...
0
votes
0answers
81 views

Apache Options +Includes is ignored

I have the main config file of Apache/2.4.17 (Unix) with: DocumentRoot "/usr/local/apache2/htdocs" <Directory "/usr/local/apache2/htdocs"> Options Indexes FollowSymLinks AllowOverride ...
1
vote
1answer
86 views

Can't get included CSS and JS files to be compressed

I have enabled compression via .htaccess and in httpd.conf However when I run it through the various online testers, its always saying that various included files are not compressed. Apache version ...
0
votes
0answers
26 views

Apache htaccess precedence

I am wondering about the order of precedence within an htaccess file. I have a RedirectMatch outside of any block that is being over-ruled by a FilesMatch directive later in the file. How can I ...
0
votes
1answer
249 views

Can I use Gulp to modify my .htaccess file with different configurations for Dev & Production?

I have two CentOS boxes running Apache. One is my dev environment and the other is my production environment. I am looking at using Gulp in a process of pushing from my dev server to my production ...
0
votes
1answer
15 views

.htaccess not behaving as desired

Eventhough I'm new at htaccess, I've been learning a lot in the past few days, but I'm stuck on a certain part that resulted in the website not behaving as desired. Here is the part of the code where ...
2
votes
2answers
180 views

Special characters in URL causes custom redirect to fail

I have a domain on which I am trying to set custom redirects for the error pages. My .htaccess file looks like so: RewriteEngine On AddDefaultCharset UTF-8 DefaultLanguage en-US # disable TRACK and ...
-2
votes
1answer
107 views

How to rewrite URL by removing the last two characters within the htaccess file?

How to rewrite a URL by removing the last two characters within the .htaccess like following? /blog/?m=20150218 rewrite to /blog/?m=201502 I have tried for following but not working: RewriteCond ...
1
vote
1answer
38 views

.htaccess redirect only for homepage?

My website has more languages and I want to do this redirect for every languages for example: /es/ to /es, simple with Redirect but this method make problems for subpages, how can I tell htaccess to ...
0
votes
1answer
40 views

System error in Apache with combination of https redirection plus password requirement plus error document

In an Apache 2 vhost I have the following configuration (in my case, in .htaccess of the document root (which is for simplicity the same for http:80 and https:443) RewriteEngine On RewriteCond ...
1
vote
1answer
48 views

Is it possible to limit connections per “user agent” in htaccess?

Say my goal is to limit the number of users visiting my site concurrently via "Mozilla" (firefox) user agent, is it possible to do in apache 2.2? I'm thinking using something along the lines of: ...
-1
votes
1answer
88 views

Is there any way to make Nginx use .htaccess files?

I know .htaccess files are very detrimental Apache's performance and are avoided by Nginx because they are considered "doing it wrong." Unfortunately I have to support a massive web app that is built ...
0
votes
1answer
78 views

VirtualHost/htacess : how to point a subdomain to an url parameter?

I must to create a multi-languages website. In order to achieve this aim, I want to point subdomain representing a language to the 1rst url parameter (GET variable) of the domain in my virtualhost ...
0
votes
0answers
14 views

Forcing HTTPS across site is intermittent

I've a Wordpress site on my server. Within it's root directory I've got my htaccess file. Within this file I've the following lines of code: #Begin https redirect RewriteCond %{HTTPS} off RewriteRule ...
0
votes
0answers
44 views

protect a wordpress url with .htaccess password method

I have a WordPress site, where I want to restrict user access for certain URLs (i.e site.com/training/private and all the URLs that follows /private/) through .htacces method I have used the below ...
1
vote
1answer
208 views

Exclusion of a protected sub-url does not work on Apache 2.4?

I try to exclude a sub-url "/shop/api" from my protected website. It worked fine on different server on Apache/2.2.15 but now not with Apache/2.4.7? It always asks for the basic authentication. Any ...
-1
votes
1answer
74 views

I can't prepend HTTP://WWW to the URL when I redirect to the same domain

There is this WordPress application on OpenShift that uses CloudFlare as DNS server. OpenShift gives us a URL such as app-user.rhcloud.com and allow you to add alias. Such as www.website.comand ...
0
votes
0answers
185 views

Redirect my main domain to https using .htaccess, not sub domains

My main site needs to 301 redirect to https but I have other sites housed in that folder. They work fine as http but if I need to redirect a parked domain to that sub-site it attempts to force https. ...
0
votes
0answers
113 views

Prerender with my angular application

ive asked this question on Stackoverflow and got suggested to try here so i am hoping some of you can help: I have followed the following guide: In angular: $locationProvider.html5Mode(true); In ...
-1
votes
1answer
43 views

Mod rewrite regex htaccess

I've been using mod_rewrite in order to block some user agents but now, I'm getting an 500 Error and error_log: /var/www/htdocs/.htaccess: RewriteCond: cannot compile regular expression I think ...
0
votes
0answers
18 views

Direct two web pages to https while maintaining the rest in http

I am successfully directing my profile page to https while keeping the rest in http. I am having trouble adding another page to be directed to https without causing an infinite loop. The page I am ...
0
votes
1answer
90 views

Redirect to Maintenance file with .htaccess

i'am trying to do a simple redirect to a maintenance page, but seems like apache won't let me do ! i have a folder for 3 version of a wiki (each with a specific language), so i want to redirect each ...
1
vote
0answers
54 views

Using Apache mod_rewrite to rewrite host to subfolder, but it redirects instead of rewrite

I want to simulate virtual hosts by .htaccess, so I want to rewrite hostname to subfolder. It works, but on some URLs it don't rewrite but redirects. This is my .htacess file: RewriteEngine on ...
0
votes
0answers
27 views

SSL Subdomain redirects to servers IP Address [duplicate]

I have a server with Apache installed under FreeBSD. I have enabled rewrite rule and applied it to .htaccess (can be seen below); Ref: http://stackoverflow.com/questions/9985735/redirect-ip-to-domain ...
0
votes
0answers
218 views

/var/lib/tomcat7/webapps/ROOT/.htaccess: DeflateCompressionLevel not allowed here

i have absolutly no idea about this failure. I always get this Error when i set to "DeflateCompressionLevel 9" in my .htaccess In the Apache error log: [alert] [client 192.168.1.12] ...
0
votes
0answers
36 views

Disable redirect using htaccess

I have the following www.mywebsite.com/page1 I have written a redirect statement that takes the user to this page when encountering a certain condition. That condition also exists within the ...
-1
votes
2answers
138 views

Block direct access to port 3838 when using shiny

I have a shiny server listening on port 3838 (Centos 6 Environment). I would like to block direct access to http://www.mywebsite.com:3838 which reveals the shiny files and directories. Any time I ...
0
votes
1answer
45 views

Write .htaccess file to configure subfolder as documentroot

I have the following directory structure. /var/www/html is the DocumentRoot. var www html demo css abc.css js abc.js index.html How can I ...
0
votes
1answer
187 views

Nginx rewrite subdomain to subdirectory without changing the URL

I've been using Appserv for a while and moved to Nginx for now. When I was running my website under Appache I had this configuration in the .htaccess file in order to link the subdomain to the ...
0
votes
0answers
31 views

htaccess to add cors headers and redirect to cgi-bin

Quite simply I need to add some cors headers (preferably) via htaccess, like so: Header always set Access-Control-Allow-Origin "*" Header always set Access-Control-Allow-Headers "origin, ...
1
vote
1answer
69 views

Using multiple .htaccess files with multiple ErrorDocument 404 entries

Here's what I'm trying to accomplish. Right now, in /var/www I have an .htaccess file with multiple ErrorDocuments defined for various errors. I also have subsites (i.e. /var/www/tf2c, ...
0
votes
1answer
19 views

Protect a directory if remote host is/is not

How can I protect a directory within .htaccess only if the remote host is not 192.168.1.11 ? Below is how I actually protect directories: AuthUserFile /home/personal/.htpasswd AuthName "Auth Area" ...
-3
votes
1answer
147 views

.htaccess causes infinite loop on live server but works on localhost [duplicate]

I'm a newbie .htaccess and regex. I have a script that works locally but when I upload it to a live server it causes an infinite loop. How can I fix this? On the site when you load ...
1
vote
2answers
87 views

Apache 2.4 Convert .htaccess rewrites to vhost.conf

I have a .htaccess rewrite that I would like to move to a vhost.conf (I don't want to use .htaccess) RewriteRule ^(.*?)(test_mod_rewrite) /$1media/plg_jchoptimize/assets/modrewrite.php?q=$2 ...
0
votes
0answers
25 views

Ganglia private page

I have read the Ganglia documentation about authorization systems (https://github.com/ganglia/ganglia-web/wiki/Authorization-System). I would like to restrict all access to the page via htaccess so ...
1
vote
1answer
50 views

Redirect rules for .htaccess with mod_rewrite

I have a PHP script dynamically generating content from a database based on queries. The user might do a search from a text box for the username "mark". The content is provided by PHP at ...
2
votes
0answers
20 views

How To Stop Apache Logging Client Denied By Server Errors [duplicate]

I get an annoying amount of spam traffic from the Ukrane, Russia, Korea etc. I have setup rules in my .htaccess file to block all of these countries and it's working great. The problem i have now is ...
0
votes
0answers
112 views

Converting NGINX to apache rewrite rules

Currently I am doing a project setup in my local(Apache) whichi is in NGINX. I am facing trouble in converting the rules from NGINX to .htaccess rules. Can some one help me out in converting the ...
0
votes
4answers
2k views

How to block Ip in .httaccess on Apache 2.4

I've upgraded Apache 2.4 and would like to block an Ip this could be done by using the following in the .httaccess on Apache 2.2 Order Deny,Allow Deny from 50.62.136.183 However how can I achieve ...
0
votes
1answer
36 views

Some mod_rewrite syntax clarification

We inherited some code recently and I'm reviewing the .htaccess file of one of the sites. I understand what the end result of most of the rewrite rule sets are, I'm just unsure of some of the syntax. ...
0
votes
1answer
36 views

Convert htaccess rewrite rule

I want to convert this to nginx rules # BEGIN EAP Rewrite <IfModule mod_rewrite.c> RewriteEngine on Options -Multiviews RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f ...