Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
2answers
80 views

Change port and host using .htaccess

I am trying to use mod_rewrite to basically port forward a port on a subdomain to another port on another IP. Like this: sub.website.com:2000 --> 123.45.67.891:3000 How could this be ...
0
votes
0answers
54 views

mod_rewrite in .htaccess w/ wildcard virtual hosts - preserving subdomain while funneling requests through index.php

I have a project which utilizes wildcard subdomains to allow requests for www.foo.com, api.foo.com, & admin.foo.com to utilize the same document root. Routing for this project is based initially ...
0
votes
2answers
22 views

make a subdirectory public

I have a web site which is protected with basic authentication I need to make a sub directory public. Tried using but it ended in error 500 - server error Also tried using separated .htaccess files, ...
0
votes
1answer
27 views

Redirect each request to index page

I'm trying to redirect all the user's requests to my index page, except the one made to the root folder. So www.domain.com/page.ext is fine while www.domain.com/folder/page.ext has to be redirected. ...
0
votes
0answers
12 views

protection against Apache Benchmark via htaccess [duplicate]

How, via htacess, could I prevent a website to be "Apache-Benchmarked" (ab)? Thank you
0
votes
1answer
59 views

Automatically prepend executable Perl scripts using .htaccess (like php_value auto_prepend_file)?

I have previously built sites using PHP, where I automatically included header and footer html using the following lines in .htaccess on an Apache host: php_value auto_prepend_file ...
0
votes
2answers
103 views

How do I redirect only the root page to another subdomain via htaccess?

I am trying to redirect only my top level domain eg. domain.com to sub.domain.com. The inner pages of the domain should not be redirected. I followed the following link: How to redirect root and only ...
0
votes
0answers
45 views

disable php_value / forbid override htaccess

I'm proposing to my clients a shared environment where they all have their open_basedir jailed directory tree. This tree is generated dynamically, so I can't use a httpd.conf per directory directive, ...
1
vote
2answers
44 views

mod_rewrite: rewrite existing file to slug, slug to existing file

My situation is as follows: I have static files in folder public/ on my local server. Any request that comes in should be forwarded to that folder, but if a file in that folder is accessed directly, ...
1
vote
3answers
95 views

Is there a way to password protect a directory with .htaccess and have it remember the password?

My experience is that using .htAccess to password protect a directory, it brings up a modal dialog box. And for some browsers (FF and Chrome) don't show the checkbox for "remember" this password. Is ...
0
votes
2answers
41 views

Apache htaccess strange behaviour with rewrite rules

I don't know what's going on but I cannot make use of the rewrite module. In my .htaccess file I have a rule like this: RewriteRule ^test$ test.php. If test.php does not exists I get a 404 error ...
0
votes
1answer
30 views

Trying to Redirect from site1.com to site2.com using htaccess without changing url in the addressbar

Is there anyway I can redirect from site1.com to site2.com without having url change in addressbar. I have tried different solutions available here which are mostly for redirect rule/conditions ...
0
votes
2answers
49 views

SSL on another PORT

We have a web server that can handle SSL requests, but on port 445 instead of 443. So https://domain.com doesn't work, but https://domain.com:445 does. How can I use .htaccess to issue a redirect to ...
0
votes
1answer
20 views

redirection based on domain name instead of file name

I have 10.8 Server with Filemaker Server 12 running two pages in Instant Web Publishing. The pages are accessible locally: http://192.168.168.42/fmi/iwp/cgi?-db=exampleONE&-loadframes ...
0
votes
2answers
61 views

RedirectMatch: how do I avoid preserving querystring

I've noticed that the RedirectMatch directive preserves the querystring across the redirection. That is, if http://www.mydomain.com/someurl?some=query matches the rule, then it is redirected to ...
3
votes
1answer
141 views

Apache 2.4 with PHP-FPM .htaccess redirection

I have Apache 2.4 set up with PHP-FPM on a server. To pass from Apache to PHP-FPM I use the following: ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9001/hosting_files/site.com/admin_secure/$1 ...
1
vote
2answers
42 views

How to ignore upper directory .htaccess Options?

How do I have a current directory .htaccess ignore Options from upper directory .htaccess?
1
vote
2answers
54 views

Using several rewrite rules .htaccess

I have a website wich is based on a searchpage, which shows a list, and next is a detail page of the items. if visitors use rootdomain.com/searchterm, should be redirected to ...
0
votes
1answer
36 views

.Htaccess - File extension gets not removed

I'm using the .htaccess below to remove the .html file extension but if someone types in example.com/test into the browser it redirects to http://www.example.com/test.html . Why does ...
0
votes
3answers
65 views

wordpress in subdirectory apache2 without browse index and .htaccess

Sorry if this has been asked before but I looked through other posts and couldn't find my answer. Wordpress is up and running inside /var/www/wordpress/ However when I browse to www.mysite.com I get ...
0
votes
1answer
44 views

Convert .htaccess http authorization to nginx

I need to convert the following .htaccess string to nginx config: RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}] Can anyone help me? I'm running nginx + php_fpm configuration.
0
votes
2answers
37 views

Protect a directory via .htaccess which is located out of main directory

I am serving a documantation database and link a directory-listing which are located outside of the main directory. Like: Apache main directory: /var/www/ Files: /scratch/files/ I added the ...
0
votes
0answers
29 views

Files in my server can be accessed..only once at a time

I have a tiny "webpage" in an Apache server running on my computer. I've got for it this .htaccess file: <filesMatch "\.(html|htm|js|css)$"> FileETag None <ifModule mod_headers.c> Header ...
0
votes
1answer
43 views

301 Redirect, need to drop file name

I have many redirects working but I have one that needs to be redirected and drop the file name. redirect 301 /path/to/file/default.aspx http://www.domain.com/newpath/to/page/ When I implement this ...
0
votes
0answers
32 views

Htaccess on a server behind a Proxy

I have an apache server that is part of a cloud servers network. The virtual server its configured to respond at port 9000, but you access from outside through port 80. Thats working fine, except for ...
2
votes
1answer
59 views

Not all .htaccess files are read

I have used MAMP and Ubuntu server for years but have recently tried to use the built-in Apache Server on Mac OS X 10.7.5. My problem is some of my .htaccess files are being read and some are not. I ...
-2
votes
1answer
56 views

Stop .htaccess blocking cron jobs [closed]

I have a php script on my site that, when run, changes the 'Dog of the Day' on my home page. I have a cron job set up to run the script once a day, and everything works perfectly. I've secured my ...
1
vote
3answers
56 views

Redirecting all sub pages to another subpage using htaccess

I've a older site running in Apache Server which is already indexed in Google. I wish to redirect all those indexed links to my new site (As the older pages are not existing any more.) So i wish to ...
-1
votes
1answer
26 views

mod_rewrite to a specific page content

I want to redirect all pages other than index.php to a specific section inside the pages. Like this: mydomain?pagerequest to mydomain?pagerequest#navigation. Could you guys please help me?
1
vote
2answers
65 views

Setting permissions for mp4 and png files in .htaccess

First, I'm brand new to Apache .htaccess. I've got a server that must allow users to dive only into mp4 and png files. So, I've been reading Apache HTTP Server documentation and, according to what it ...
0
votes
2answers
26 views

Redirecting a query search from old domain to the new domain using .htaccess

I want to redirect a query search from my old domain to my new domain like mysite.com/?q=foo to othersite.com/?s=foo using .htaccess I've tried any .htaccess codes but not worked well.
0
votes
1answer
40 views

How can I use Apache RewriteRules + PHP to determine which page to show?

I am trying to make a scalable RewriteRule on my .htaccess, I use each word before slash as a parameter. for example: http://localhost/mysite/param1/param2/param3/.../param20 I am working with this ...
-1
votes
1answer
136 views

Removing double slashes from URL [closed]

For some reason in some cases I get two slash signs in web page's URL (ie. http://mydomain.com//val1/val2/val3/val4/). Can you help me please how to remove them?
0
votes
1answer
22 views

500 Error when using Apache Directory Directive

I am trying to restrict access to certain directories to certain IP's.... I have done some research & the below is what I came up with, however it returns a 500 internal server error when I try ...
1
vote
1answer
145 views

Can't gzip some JS and CSS files

I am optimizing a magento store, and some JS and CSS (compiled and minified in a MEDIA folder) aren't being served gziped as they should. All pages are gziped (ex. this HTML page) but some content ...
0
votes
1answer
46 views

htaccess redirect http to https causes redirect loop

I have edited my .htaccess file to redirect any http request to https://mydomain.se however, this has cause the website to fall in redirect loop. I have looked at the other solutions and compared them ...
0
votes
0answers
19 views

.htaccess Redirect [duplicate]

When I get a request in this form http://website.com/dir1/dir2/abc I should redirect it to particular page txt.php. It should be easy if I know what abc is. But I have no idea on abc and it shall ...
0
votes
2answers
134 views

Redirecting https urls to the http equivalent using htaccess file

The situation I have is that I have made a new website for a client, the URL format of which is http://newsite.com. The clients old website used SSL and had the URL format https://www.oldsite.co.uk. ...
0
votes
1answer
72 views

RewriteRule (to remove .php) and old redirect 301 not working?

I'm not experienced in editing .htaccess I wanted to redirect non-www to www. remove .php extension set up a custom 404 page I managed to do this (looking for solution in the web and on ...
1
vote
1answer
43 views

Hide every directory in a folder from index, but not their contents

On my server, I want to create a directory hidden from normal users, but that is accessible with a link without authentication. Currently I have set it up like this: In the virtual host ...
0
votes
1answer
70 views

ubuntu 12.10 .htaccess still not working

I have just installed the Ubuntu 12.10 and I am getting some errors.. I have install the apache2 - ok. But when I am using the .htaccess file in my webfolders I am still getting error 403 forbidden. I ...
0
votes
0answers
55 views

mod_rewrite: multiple domains, append slash and serve from subdirectory is apparently too complex for my brain

I know there are a lot of mod_rewrite threads out there. I tried SO, SU and others but I just can't get this to work (I wont tell you how long I already worked on it :>): I have ~12 domains. ...
0
votes
1answer
166 views

.htaccess with .htpasswd on site root causes redirect loop

I want to temporarily password-protect a site. I have an .htaccess file in the site root containing: AuthType Basic AuthName "Example Site Name" AuthUserFile /home/my_username/.htpasswd Require ...
1
vote
1answer
22 views

HTAccess Allowing Login By Using Name As Password

I have an issue where my server is accepting a faulty password for my site. For example, my domain name might be "johndoe.com" and the scenario is ht login name: johndoe ht password: johndoe123 ...
3
votes
1answer
100 views

.htaccess redirect all extension to php

I recently updated my .htaccess file to hide the .php extension of the urls. It works nice, when I try to reach domain.com/index, it displays the php file. When I type domain.com/index.php it ...
0
votes
1answer
35 views

Htacces mobile redirect loop

im need to change the template of my site if mobile is detected but im getting a redirect loop. this is my htacces code. Anny help will be much appreciated. Thank you! RewriteCond %{HTTP_USER_AGENT} ...
1
vote
1answer
161 views

Unable to set php_value in .htaccess file

I am trying to set up NewRelic on my Apache2/PHP server, and have it report different applications per vhost. To do this, the php value newrelic.appname must be changed. It is definited by default in ...
0
votes
0answers
116 views

Codeigniter htaccess issue

First of all I'm running the production project on my local webserver. The project has one subproject: https://mylocalip/project/ - main project wich will be moved to https://domain.ext ...
0
votes
3answers
110 views

.htaccess - Redirect to https

I'm using the following .htaccess to redirect example.com or www.example.com to http://www.example.com. RewriteEngine on RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^(.*)$ ...
0
votes
2answers
133 views

Redirect without changing url htaccess [duplicate]

I want to create a file .htaccess for a invisible redirection. The goal is when i input www.site1.com i have to redirect to www.site2.com without changing url in address bar. Thanks in advance.

1 2 3 4 5 29