Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
30 views

How to cache particular file in folder using .htaccess

i tried google and found one solution at 'http://webmasters.stackexchange.com/questions/24881/cache-a-particular-image-using-htaccess' but it cache all the file of folder, i want to cache only ...
2
votes
3answers
155 views

nginx [emerg] unknown “0” variable

I've been trying for two days to convert an .htaccess to nginx rewrite the original file looked like this: # Turn on URL rewriting RewriteEngine On RewriteBase // # Protect hidden files from being ...
0
votes
1answer
18 views

Alter RewriteRule to change parameter results

Here is my Apache 2 Directory configuration: <Directory /var/www/html/website/> Options +SymLinksIfOwnerMatch RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f ...
2
votes
1answer
192 views

Apache, htaccess, url rewrite

I have .htaccess file I'm using for testing, here is my file: RewriteEngine On RewriteCond %{REQUEST_URI} ^/([a-z-]+)/?$ [NC] RewriteRule ^ %{REQUEST_SCHEME}://%{SERVER_NAME}/?title=%1 [L] I'm ...
1
vote
1answer
300 views

htaccess redirect whole url as parameter

We have created an iframe loader index5.php which will show two iframes, iframe1 and iframe2. The content of iframe2 can be set by accessing index5.php?url=iframe2url. So, going to ...
0
votes
1answer
190 views

Configuring .htaccess on a site with a CodeIgniter app and traq issue tracker

I have this site running on CodeIgniter and I have installed traq for issue tracking. Under public_html I have my application and system directory as well as an assets directory, and also traq. i.e.: ...
0
votes
0answers
73 views

Cache-Control only working for media files and not static files served in Django

I'm trying to use Cache-Control for my static files. Following is my code for the .htaccess file # 1 YEAR <FilesMatch "\.(ico|svg|woff|eot|ttf)$"> Header set Cache-Control "max-age=31536000, ...
0
votes
1answer
663 views

.htaccess not being loaded in Ubuntu 14.04 (Apache 2.4.7)

I'm trying to use the .htaccess file in Ubuntu 14.04 (Apache 2.4.7). Here is what my .htaccess looks like # 1 YEAR <FilesMatch "\.(ico|svg|woff|eot|ttf)$"> Header set Cache-Control ...
0
votes
1answer
27 views

static files from subdomain, fcgi from root

I would like to send requests for foo.com -> foo.com/dispatch.fcgi and requests for a subdomain bar.foo.com -> foo.com/bar I have this in my .htaccess file; AddHandler fcgid-script .fcgi ...
-1
votes
1answer
145 views

Apache .htaccess set different password for symlink

I got a domain with a website that can be reached by two urls, mydomain.com/pathA and mydomain.com/pathB. But they are actually the same directory on the server. It contains a MediaWiki ...
0
votes
1answer
20 views

Lighttpd: How to migrate a rewrite rule?

i'm using this htaccess rule on a apache: RewriteEngine on RewriteCond %{HTTP_REFERER} example\.com [NC] RewriteRule .* - [F] .. and i would convert it to an lighttpd rewrite rule. How can i do ...
0
votes
1answer
647 views

.htaccess file causes “500 Internal Server Error” but no error log entry

I set up an apache manually and added a second web directory with this code: Alias /webs c:\webs <Directory /webs> AllowOverride All </Directory> However, this web has an .htaccess ...
-2
votes
1answer
183 views

Apache Redirect to another folder, both within and outside document root [closed]

I've recently set up a home web/media server and having a few difficulties with a few of the settings. It's working fine for serving webpages etc but I've now reorganised the structure of the main ...
-1
votes
2answers
71 views

.htaccess file isn't working for https

I have simple .htaccess file to forbid access to a directory as : order allow,deny deny from all Well, it doesn't work with SSL and show the content of directory if client access the directory ...
0
votes
3answers
116 views

Deny connection to and from a specific hostname on Ubuntu/Apache2

My wordpress EC2 server was probably hacked. When running iftop command I can see that my server sends and recieves data from a hostname name "i157panamamails.com". This hostname never goes away and ...
-5
votes
1answer
41 views

Configure subdomain godaddy and use an existing CERT [closed]

I just created a subdomain ony my domain named: profile.cv.hsoto.me However, when I try to access it, I get a warning: I'm not sure how to fix this. My .htaccess file is as follows: # BEGIN ...
1
vote
1answer
127 views

Why can't I redirect url's with “index.html” in it to a php file?

I'm stuck in a big problem, but let me start with one part of it. I am wodering why this works: RewriteRule ^(.*)index.html $1 [R=301,L] while this doesn't: RewriteCond %{REQUEST_FILENAME} ...
15
votes
4answers
26k views

How to get apache2 to redirect to a subdirectory

I am running apache2 on debian etch, with multiple virtual hosts. I want to redirect so that http://git.example.com goes to http://git.example.com/git/ Should be really simple, but google isn't ...
0
votes
2answers
55 views

Apache: Stealth 404 the admin area until authenticated via basic auth, then allow access

Given a administrative area with urls like this: wp-admin/ wp-admin/whatever wp-admin/another-page wp-adminsecretlogin A standard basic-auth coverage would provide a username and password prompt on ...
1
vote
3answers
782 views

apache 2.4, mod_proxy_fcgi not honouring .htaccess, work around needed

I am using apache 2.4.7 with mod_proxy_fcgi for purpose of passing through php to php-fpm (this will be used for shared hosting environment). The htaccess works fine for non php files, but once it hit ...
0
votes
0answers
36 views

Show 404 page with redirecting to www only

I want to change the 404 error. What I did is redirecting the 404 error page to a custom one, without redirecting the URL itself. This works perfect (http://www.gincher.net/not.exist)! I'm using ...
-2
votes
1answer
28 views

mod_rewrite redirect any domain except principal domain to the principal domain [duplicate]

I have some rules as follows: RewriteCond %{HTTP_HOST} ^domain.com RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L] I would like to make the rewrite condition match ANY domain OTHER than ...
-1
votes
2answers
367 views

Autodiscover URL redirection from cPanel Apache to different Subdomain URL on an IIS/Exchange server

== The Current Situation: == We have a web and DNS server for contoso.com (10.10.10.1) This web server 10.10.10.1 is also the mail server for @fubar.contoso.com We then have another server for MS ...
0
votes
1answer
122 views

.htaccess is not working on Zend server on Windows

I am a beginner to MVC framework in PHP and also to .htaccess file. I use Zend server on Windows OS. My code in .htaccess is: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -d RewriteCond ...
0
votes
3answers
273 views

Mod Rewrite appends Document root in rewrite rules

Previously my host provider gave an option of setting up rewrite rules in apache configuration files. At that time below rule worked fine. # Non WWW URLs to WWW URLs RewriteCond %{HTTP_HOST} ...
0
votes
1answer
162 views

.htaccess Not Working Despite AllowOverride All

Apache HTTP Server 2.2.22 Arch Linux i686 I am using the HTML5 Boilerplate .htaccess with WordPress Multisite, which requires two .htaccess files. I’m not sure which would take precedence, so I ...
0
votes
1answer
57 views

htaccess password multiple password same user [closed]

How to assign multiple passwords to the same user in .htaccess password protection? It looks like this in my .pass file, but only the first one is working christina:o5hZ6Uplugq.2 ...
3
votes
2answers
405 views

Host Primary Domain from a subfolder

I am having a problem making a sub directory act as the public_html for my main domain, and getting a solution that works with that domains sub directories too. My hosting allows me to host multiple ...
0
votes
1answer
54 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
vote
1answer
77 views

apache expires not working for pyramid server

I have a pyramid server running on EC2 via apache with following configuration - <Directory path_to_virtual_env> WSGIProcessGroup pyramid Require all granted Order allow,deny ...
1
vote
0answers
179 views

blocking referring domain and all of its subdomains via rewrites in htaccess

I'm looking to block two referrers along with all of their subdomains. When using this in my htaccess, they're not getting a 403, but instead a 500 response from apache (complaining about too many ...
0
votes
1answer
1k views

Issues with htaccess URL Rewrite (specific for CPanel type hosting)

I have an application set up on Apache 2.2 CentOS (with cPanel). I am facing issues with htaccess. I have confirmed that mod_rewrite is working. My .htaccess file is laid out like : RewriteEngine on ...
0
votes
0answers
117 views

Apache Alias on multiple vhosts + redirect rules

I'm facing a tricky problem and I have problems to solve it through Apache config. I have two vHosts on my machine: A) /var/www/front/web app.domain.ext B) /var/www/api/web api.domain.ext This ...
0
votes
1answer
228 views

htpasswd - Any tip to block brute force attacks?

Update: As Craig suggested I'm trying fail2ban now. Even though I have issues in that as well. failregex is not finding any result though. I had enabled all apache* in jail.local and here is how my ...
0
votes
1answer
86 views

Conveting .htaccess to Ngix rules

I need to convert htaccess file to nginx config. I http://winginx.com/en/htaccess but an error occurred when I update the nginx config file. The htaccess file reads: DirectoryIndex index.php ...
0
votes
1answer
440 views

htaccess and rewrite - Internal redirect within Alias

I have the following .htaccess within a subdirectory: RewriteEngine on RewriteRule ^file.js$ file.php This works by internally redirecting the request to the PHP file, with the same name, which is ...
0
votes
1answer
325 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 ...
0
votes
1answer
61 views

can htaccess file define different RewriteBase for production and dev servers

I have htaccess files that use different RewriteBase on production and dev (windows) pc. Currently I change the RewriteBase manually when deploying. Can this be done automatically with some ...
1
vote
0answers
125 views

Tomcat 8 with Apache, Configure Several Java & WordPress Domains

** PROBLEM SUMMARY ** I think the subject line defines my question pretty well, but I'm going to give an example of my current and goal setup for clarification. Considering the sheer number of ...
0
votes
0answers
91 views

Multiple Rewrite rules not working in htaccess file (mod_rewrite)

Can anyone help me how to write multiple rewrite rules in htaccess file. In my condition I want to remove index.php from url and also want to use file based cache busting, I am using following code in ...
0
votes
0answers
27 views

How to allow access to the site root document in htaccess?

What I am trying to accomplish looks quite simple: allow the site's index.html for everybody and hide everything else from everybody. Needless to say the index.html file can be addressed as ...
1
vote
2answers
838 views

Apache is giving a 500 Internal server error on a sub domain created for my domain

I have created a subdomain by name http://admin.stenzsolutions.com and just to test the sub domain, i have hosted the same content as the main domain http://www.stenzsolutions.com Now i have ...
-2
votes
1answer
48 views

Redirect entire site to URL with 302 - All URLs to 1 URL [duplicate]

What i want to do is redirect an entire forum temporarily to a Twitter Page. However anything i've tried hasnt worked. If they visit for example site.com/Forum it will send them to ...
-1
votes
1answer
65 views

IIS (or .htaccess) URL Rewrite not working correctly - need to capture number argument as query string

I'm trying to have: http://sub.domain.org/123456 become http://sub.domain.org/index.php?q=123456 I have tried many ways, and one way sort of worked, but then all subdirectories (including images) ...
0
votes
1answer
66 views

How to use # in url as a redirect rule in htaccess for apache

I am having a difficult time figuring out how to have the following work: I am trying to redirect a url in htaccess I am trying to redirect from example.com/test.html to example.com/index#test I ...
0
votes
1answer
340 views

.htaccess rules to stop DDoS POST flooding

We're under a distributed denial of service attack from traffic that looks like this: 49.146.161.175 - - [11/Jul/2014:00:43:42 -0400] "POST / HTTP/1.1" 500 557 "-" "Mozilla/4.0 (compatible; MSIE 6.0; ...
2
votes
1answer
100 views

How to make htaccess not redirect to http on form submission

Part of my .htaccess file forces https on certain pages (e.g. when user logs in, enters credit card information, etc.) while forcing http on all other pages. This seems to be the ideal setup for what ...
0
votes
1answer
96 views

redirect string to different url in nginx

I want to redirect a string to different URL in nginx. This what my vhost looks like and is working fine. server { listen 80; server_name secure.example.com; root /opt/tomcat/webapps/test/; ...
0
votes
1answer
50 views

mod_alias.c rule to redirect all subdirectories

A mod_alias newbie here. I found the rewrite rule below somewhere and have been using it to block bots and hackers that hit my site, looking for directories like HNAP1, wp, blog, etc. And it works ...
0
votes
1answer
100 views

How can I rewrite from /page to /xx/page, using htaccess & apache only?

Hi I have found many resources on mod-rewrite and Apache but I haven't been successful of making a working example. The example below works for ✓ WORKS example.com/en/page1.php ☞ ...