Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

-1
votes
1answer
133 views

http:// to https:// Redirection with page reload in Apache 2 (HD Web Hosting) [duplicate]

I'm trying to check to see if the address accessed is using a secure connection when accessing a certain page, or not. If not, I want to redirect the traffic to the proper https:// address. I have ...
1
vote
1answer
290 views

How multiple <Directory> sections work in Apache configuration (httpd.conf)?

For example, if my '/etc/apache2/httpd.conf' looks like this: <Directory /> AllowOverride None </Directory> <Directory /home> AllowOverride FileInfo </Directory> ...
0
votes
1answer
602 views

RewriteBase rule works in .htacess, but not in httpd.conf (inside <Directory …>)?

Let me explain by example... File: /var/www/example.com/public/wp-content/cache/minify/.htaccess <IfModule mod_rewrite.c> # THIS WORKS... RewriteBase /wp-content/cache/minify/ ...
0
votes
0answers
45 views

Why is FilesMatch directive working

For my Drupal site's .htaccess I've this rule: # Pass all requests not referring directly to files in the filesystem to # index.php. Clean URLs are handled in drupal_environment_initialize(). ...
0
votes
1answer
187 views

Apache Alias subdomain/folder to folder above subdomain

What I want to do is to create an alias at http://subdomain.example.com/login that points to /usr/.....etc/htdocs/example/login so that anytime someone is redirected to ...
1
vote
1answer
437 views

Internet explorer cannot display the page, other browsers can, possibly htaccess / server error

After the migration of a high traffic site, from Redhat to Suse, Internet Explorer users (of at least IE 9) have, in some cases, troubles to view the frontpage (error message: "Internet explorer ...
0
votes
1answer
57 views

htaccess rules unexpectedly forcing download of gzipped index.html [duplicate]

I'm trying to set up SSL on a Wordpress site. The SSL certificate does not cover both www. and non-www. versions of the URL, so I'm trying to simply redirect everything to https://domain.tld with ...
-3
votes
2answers
147 views

Mod Rewrite code with out changing the url in address bar

I When I call http://www.mysite.in/abc/xyz it shoud show up http://www.mysite.in/abc/xyz/index.php but the url shout not change in address bar and it should work with out "/" in the address. Please ...
-1
votes
2answers
76 views

Website link with out “/” [duplicate]

My Apache 2.2 is running on port "8080" I want to call my site url http://www.example.in:8080/abc/xyz.html/index.php (xyz.html is a folder) as .... http://www.example.in:8080/abc/xyz.html Can ...
0
votes
1answer
160 views

How to rewrite /index.php to /app.php [duplicate]

I have this in my .htaccess file: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] RewriteEngine On ...
-1
votes
1answer
27 views

redirect / to /?C=N;O=A [duplicate]

I want to be able to use IndexOrderDefault Descending Date for all of my sub-folders, but I want to the first page to be sorted by name (A-Z) I read ...
0
votes
1answer
57 views

htaccess redirect querystring value

I need to redirect www.URL.it/directory_one/index.php?param_one=XXX&param_two=**YYY** to www.URL.it/newpage.php?param_three=**YYY** I tried all I found online but the only things that works ...
0
votes
1answer
57 views

How to force HTTP for some pages in HTTPS forced website with htaccess? [duplicate]

A part of my htaccess that redirects HTTP traffic to HTTPS looks like this: RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] I need allow ...
0
votes
1answer
229 views

how to stop htaccess URL redirect loop [duplicate]

I am new to htaccess. so when i want to do a url redirect using htacces, i always get a redirect loop, and don't know how to fix it. I have been searching on the web but coundn't find a solution for ...
0
votes
1answer
111 views

Rewrite condition rule to see if there are variables after the slash

Here's what I'm looking to do: if http://acme.com/ has nothing after the slash rewrite to http://www.acme.com/ if http://www.acme.com/ has nothing after the slash do not rewrite if http://acme.com/ ...
0
votes
1answer
97 views

redirect a directory to a new domain without touching the main website

I would like to redirect https://mineyourmind.de/forum to https://mineyourmind.net/forum . Every rewrite rule I could google didn´t work, they also redirected the main domain (mineyourmind.de). Im ...
0
votes
0answers
119 views

Query String results in 404 using DirectAdmin (Apache 2.46 and PHP 5.3.27 PHP-FPM)

Having a bugger of a time with this one... not sure if it's a bug in DirectAdmin's scripting or something in HTTP or PHP that is causing the issue. Site is hosting a WP installation... basically any ...
0
votes
0answers
61 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
324 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
110 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
182 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
106 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
52 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
498 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
118 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
75 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
67 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
80 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
43 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
1k 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
80 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
708 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 ...
5
votes
1answer
180 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
80 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 ...
2
votes
1answer
4k 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
1answer
32 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 ...
1
vote
0answers
32 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
111 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
130 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
77 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
125 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
46 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
91 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
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
174 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
21 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 ...