Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

-1
votes
1answer
55 views

Rewrite only if Image don't exists with .htaccess

How do I make RewriteCond+RewriteRule change site1.com/folder1 to site2.com/folder1, only if file in this directory don't exist. For example: site1.com/wp-content/uploads/2014/03/image.jpg If image ...
-1
votes
1answer
31 views

Point a new domain at existing files but keep new domain url

I have a directory: http://mysite.com/somedir/ I have a new domain: http://myothersite.com I want my new domain to point to the files in http://mysite.com/somedir/ but retain it's own url. So that a ...
-1
votes
1answer
25 views

Disable custom php.ini

I want to disable custom php.ini inside my shared hosting. I dont want to allow my clients to use it. I could block the usage of htaccess using allowverride but I cant see someway to block php.ini!
0
votes
0answers
12 views

htaccess redirect after changing a string [duplicate]

My website is www.niresh12495.com recently i have changed my url pattern Previously http://www.niresh12495.com/page/apple/articles/what-is-hackintosh-for-beginners-and-noobs-r43 Currently ...
1
vote
2answers
107 views

.htaccess redirect visitor if he has a cookie is from accounts.google.com [closed]

I am creating a gateway page that redirects visitors based on what services they are using. How should a .htaccess rule that redirects a visitor if he has a cookie originating from the domain ...
-1
votes
1answer
40 views

Mod rewrite htaccess worked on old server, not on new server

I have the following .htaccess file, which worked fine on my old host. I moved over to an AWS instance (Ubuntu 12.04 LTS), and it's no longer completely working: <IfModule mod_rewrite.c> ...
0
votes
1answer
90 views

Apache SetEnvIf failing to match Request_Uri

Simple condition, which never match and set variable: SetEnvIf Request_URI "^/path/to/something*" access_granted Checking URI by using PHP is giving correct string, however variable is never set. ...
1
vote
0answers
42 views

Password protect website

I'm trying to password protect my website from ONE ip address. I just want to restrict an ip from accessing my website, but still allow them to access it if they have the password. My current code ...
0
votes
1answer
31 views

Apache Require env is ignored

I have following simple directive in .htaccess, I like to allow access by env, condition: SetEnv ABC 1 <RequireAny> Require env ABC </RequireAny> Seems to me very simple, but Access ...
1
vote
1answer
106 views

Nginx htaccess rewrite specified folder

I tried to convert this htaccess rules to nginx: apache # Necessary to prevent problems when using a controller named "index" and having a root index.php # more here: ...
0
votes
0answers
87 views

Redirect only /index.php page and allow access to all sub directories

I'm running ExpressionEngine (www.mywebsite.com) as the root of my website and Magento in a sub directory (www.mywebsite.com/store) I'm trying to redirect the Magento homepage (and only the homepage) ...
-1
votes
1answer
57 views

Block certain requests starting with specific string using .htaccess in apache

54.215.234.39 - - [02/Apr/2014:10:51:35 -0400] "GET /ProductSearch.aspx?qs=94307 HTTP/1.1" 404 11414 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0" I am ...
0
votes
1answer
68 views

Best way to optimize site speed for a large traffic website? [closed]

I'm currently managing a Website for a client of mine who gets about about 500-1000 visits minimum a day, and this includes Members uploading videos, photos, blog posts and other content. The site ...
0
votes
1answer
96 views

Redirect logged-in users to https, anonymous to http using Varnish+Apache

I've got a server with Varnish in front of Apache in front of Drupal. What I'd like to do is redirect my login form to https (easy enough), then redirect all logged-in (authenticated) users to https ...
0
votes
0answers
32 views

Redirect 301 with htaccess [duplicate]

we are currently creating a new website for a client, and we have to move the domain from an IIS server to Apache, new website mean new path, and if that was not enough the client want to change his ...
1
vote
1answer
55 views

apache change proxy request url rewrite

I have problem with proxy requests. I need to enable apache mod_proxy for my subdomains but i forgot to set Allow from mydomain.com, it was Allow from all...Yes, i created open proxy for all world... ...
0
votes
1answer
26 views

Serving from different directories for Internet Explorer

We have two different versions of our website - one for older versions of Internet Explorer (7 and 8), and one for all other browsers. (arguments around JS feature detection have been made, but we ...
-2
votes
1answer
39 views

Where to save nginx rewrite rules? [closed]

I am thinking about replacing apache webserver with nginx but some websites use .htaccess file and I want to ask... it is possible to declare rewrite rules inside website directory and not in server ...
1
vote
1answer
30 views

How to secure open journal system original submission files

I have installed ojs in my own server. In the installation process, it is required to create a folder that is writable by php (apache = www-data), but not accessible from the browser. The folder is ...
0
votes
1answer
37 views

htaccess redirectmatch all of 1 type of file in all subdirectories under a certain level

I need to redirect jpgs (that don't exist any more) that scummy picture crawler sites are still trying to access from the picture directory on our old site. RedirectMatch 301 (?i)/Portals/5/.jpg$ ...
0
votes
1answer
49 views

Blocking request with query string

I'm an under a DDoS attack though I have cloud flare.. I found out that the attacker is accessing the server using query strings "?a=randomnumber" I don't use query strings in my website so I need ...
-1
votes
1answer
38 views

What's the RewriteRule in htaccess to redirect to a different port? [duplicate]

I want to redirect all the request like url/api/something to a different port (say 8000) with the same base URL RewriteCond %{REQUEST_URI} ^/api/\w*$ [NC] RewriteRule ? What is the RewriteRule? ...
0
votes
0answers
14 views

.htaccess rewrite sub directories as url query [duplicate]

I have .htaccess file in my root directory of the server. All the web pages in the server are in directories, like /Animal/Dog.php (the page can also be used without the extension). There are no ...
0
votes
2answers
57 views

Can Apache be configured to ignore corrupt .htaccess files but respect them if they are correct?

I have a program writing and updating some RewriteRules in an .htaccess file (the main config is in the vhosts section). This works fine most of the time, but sometimes the file gets corrupt. When ...
-1
votes
1answer
29 views

apache disable unconfigured subdomains [duplicate]

There is a webserver which has example.com, www.example.com, my.example.com, shop.example.com, static.example.com. All sites except www.example.com is on https. My problem is when I type ...
1
vote
0answers
18 views

RewriteBase in httpd.conf + RewriteRule in .htaccess? [duplicate]

RewriteBase is set in httpd.conf for an alias: Alias /test /home/user/test <Directory "/home/user/test"> AllowOverride All Allow from All RewriteEngine On RewriteBase /test ...
-1
votes
1answer
53 views

Block Wildcard User-agent

how can i write rewrite condition for wildcard user agents here is the code I'm trying but doesnt work RewriteCond %{HTTP_USER_AGENT} !*uTorrent* [NC] RewriteCond %{HTTP_USER_AGENT} ...
0
votes
1answer
89 views

htaccess to Allow Downloads from Specific User agent and HTTP Referrer [duplicate]

i want to allow some files to be downloaded if only the user agent or referrer match the following These are the user agents uTorrent *Bittorrent* Transmission This is the http referrer ...
1
vote
1answer
54 views

Apache2 htaccess issue [duplicate]

I'm currently having issues with getting Apache2 to recognize an .htaccess file. I'm currently running the server locally on my machine for testing purposes. I can get my index page to load up ...
-1
votes
1answer
52 views

Apache htaccess get subdomain and prepend it to path [duplicate]

this is my first question on ServerFault and I think I couldn't find a similar one. To the point. I would like to achieve the following using my .htaccess. subdomaina.example.com/stats/ -> ...
1
vote
0answers
59 views

403 error from 403 ErrorDocument

I've the following configuration script in my Apache 2.4.7 installation: <Directory "/www"> Options Indexes FollowSymLinks AllowOverride All <RequireAll> Require all ...
0
votes
2answers
53 views

.htaccess errordocument disable header

I want to redirect error to specific page, so i wrote: ErrorDocument 403 /error403.html This is working, but in the HTTP response header I can still see HTTP/1.1 403 Forbidden. Some browsers ...
0
votes
1answer
69 views

convert lighttpd to nginx rewrite rules

I'm trying hard to make my code work on nginx. This configuration works with lighttpd but I want migrate it to nginx. Rewrite rules on lighttd : url.rewrite-once = ( "^/(ui)/(.*)$" => ...
0
votes
1answer
60 views

activate htaccess only on specific URI

I have an apache webserver running on an ubuntu system. To avoid access for unauthorized users, I have an active .htaccess: AuthType Basic AuthName "own area" AuthUserFile /path/to/.htpasswd require ...
0
votes
0answers
62 views

Why do AuthType Basic directives not work in .htaccess

I have a web server running on ClearOs 6. I would like to protect a couple of directories using .htaccess, but I do not seem to be prompted for a password at all. Relevant bits of conf file are: ...
1
vote
2answers
287 views

Redirect Multiple Domains to Subfolders and Hide the subfolder from URL

I have sat up two virtual host on the same ip and same document root with Apache, because I want to use shared files and contents in the document root. I want my second website point to a subfolder ...
0
votes
1answer
124 views

Rewrite rules for Anchor CMS on Lighttpd

I installed Anchor CMS on my server running Lighttpd, and I am trying to setup pretty url's. I have anchor installed in a sub-directory "/blog". The htaccess file that works with anchor cms in ...
0
votes
1answer
29 views

Use htaccess to alias to different hosting

I have a host my.site.com that doesn't support a PHP version that I need, so I got some new hosting at newsite.com that has a more up to date PHP version. I'm going host the site completely on ...
0
votes
1answer
303 views

Apache 2.4: Public Subdirectory with .htaccess

I'm currently upgrading to Apache 2.4. What puzzles me right now is how to create a public subdirectory using .htaccess only. The outer directory is protected by AuthType Basic Previously, the ...
0
votes
1answer
48 views

301 permanent redirection changing URL structure [duplicate]

I changed category urls on site. Old are like this: www.example-name.com/category-name-exactly-same-keywords/ ...
0
votes
1answer
39 views

.htaccess overwrite the deny ip list and allow a one single ip in any case?

in .htaccess i have following entries to block some certain country ip's however list is so long, its impossible to match a ip address pattern in there one by one for certain ip address, but i want ...
1
vote
2answers
131 views

Thousands of robots.txt 404 errors from bots trying to crawl old multisite

Current situation is that we are getting thousands and thousands of 404 errors from bots looking for robots.txt in different places on our site due to domain redirects. Our old website was a ...
0
votes
0answers
82 views

Mod-Rewrite - going from plain url to one with special characters

I am having a little issue with FreeBSD 10 RELEASE and Mod_Rewrite when it comes to special characters -- not in the source URL, but in the destination URL. The vast majority of Mod_Rewrites that I ...
0
votes
1answer
76 views

404 returned though rewrite rule is matched

I have one rewrite rule that sends all requests to index.php: RewriteRule ^.*$ index.php [NC,L] (Apart from RewriteEngine On, that's all there is in the .htaccess file) It works, unless the ...
0
votes
1answer
81 views

.htaccess HTTPS for all except specific files

I have a problem with a redirect in my .htaccess-File. Basically I want to send all requests to the HTTPS, which works perectly: RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ ...
0
votes
0answers
26 views

After migrating to Plesk 11 / Apache 2.2.15, some rewrite rules ignored [duplicate]

First, thanks in advance for any insight. We recently migrated to Plesk 11 / Apache 2.2.15. After doing so a number of our rewrite rules no longer work as expected. For example, this no longer ...
-1
votes
1answer
49 views

redirect for root domain only not subdomains [duplicate]

I would like to redirect my root domain to another site, but leave the subdomains in tact. so redirect mydomain.com to mydomain.com/directory, but leave alone subdomain.mydomain.com. Will this ...
0
votes
0answers
105 views

Rewriterule not working on localhost, works fine on server

I'm trying to get rid of .php extension from my webpages. Here's my .htaccess file's code RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ...
-1
votes
1answer
25 views

Redirecting url with .htaccess [duplicate]

I'm trying to redirect http://example.com/forum/index.php to http://example.com/forum/ and it will not work. Here's the code I'm using in my .htaccess. What am I doing wrong? Redirect forum/index.php ...
0
votes
1answer
40 views

Apache files directive for single file

I'm trying to restrict access to the wp-login.php file of a wordpress installation to a single IP address using the following .htaccess directive: <Files wp-login.php> order deny,allow ...