Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
11 views

How to send all HTTP error codes dynamically to one PHP file when access to all other files is denied?

I'm having the following situation, I'm developing an API. I rewrite all traffic to one PHP script named: api_route.php, using mod_rewrite like: 1: RewriteEngine On 2: RewriteCond %{REQUEST_FILENAME} ...
0
votes
0answers
14 views

Have IP address resolve to document root [on hold]

I'm a total newbie. I'm trying to figure out how to get my cpanel hosted site, which my hosting company has assigned a static IP address, to load in the browser solely by using that IP address. For ...
0
votes
1answer
12 views

Apache htaccess redirect http/www to https/non-www [duplicate]

To redirect from - http://www.domain.com - http://domain.com - https://www.domain.com to https://domain.com im using the following (apache)htaccess: <IfModule mod_rewrite.c> ...
0
votes
2answers
11k 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 ...
2
votes
1answer
1k views

Apache deflate ignores javascript

I have set up deflate in my htaccess. Everything works fine, except for some reason javascript files are being ignored. I tried every possible combination of AddOutputFilterByType DEFLATE with ...
1
vote
0answers
24 views

Apache 2.4.6 on Centor return 404 on images of specific folder

I have migrate a project from a VPS with cPanel in dedicated server using Plesk. In cPanel server, I had a folder called icons that comes with some files and some sub folders with other files. In ...
0
votes
1answer
13 views

.htaccess 301 redirect for https and www [duplicate]

I'm struggeling with the apache rewrite engine and need help to transform these address-variations: http://www.site.de/index.php www.site.de/index.php http://site.de/index.php site.de/index.php to ...
0
votes
0answers
6 views

OpenCart SEO isn't functioning even with SEO Button Enabled and htaccess configured

I have opencart installed with ubuntu 14.04, my apache config file is: <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName example.com ServerAlias www.example....
2
votes
1answer
1k views

How to block all incoming proxy visits except from one specific I.P?

I have a page that is prone to attacks, so, in order to reduce the anonymous attacks, I use this code in my .htaccess which I found online : # BLOCK PROXY VISITS <IfModule mod_rewrite.c> ...
0
votes
1answer
33 views

Switch back from Cloudflare SSL - 301 Back to http?

I need to know how put a 301 Redirect in my htaccess which points https back to http. Can you help? I see plenty of posts for going from http to https, but not in reverse! I am switching back from ...
0
votes
1answer
26 views

Is there a way of writing cleaner rewrite rules if you've a large number of redirects to implement

I recentley completed a project whereby I moved a pretty large website to a nice clean smaller website. What this meant was I had to account for a large number of pages that had been indexed by search ...
1
vote
1answer
1k 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 "max-age=...
0
votes
1answer
19 views

What is the correct way of forcing https as well as redirecting just the root of the site to another https address

Here is my .htaccess file so far, server is running apache2.4. RewriteEngine on RewriteCond %{HTTP_HOST} example1\.org [NC] RewriteCond %{REQUEST_URI} ^/$ Rewriterule ^(.*)$ https://example2.org/ [L,...
-1
votes
1answer
29 views

Redirect old domain to new domain with full path

I've very little knowledge in this area - hence the question... I'm looking to do the following: I currently have a server with a number of websites listed in sites-available and sites-enabled. There ...
0
votes
3answers
203 views

Check if file exists in subdirectory and otherwise redirect everything to main controller

What I'd like to do with mod_rewrite in a .htaccess file under Apache is the following: If a request for any file or path, e.g. foo.txt or foo/bar, is received, check if such file exists in the ...
1
vote
1answer
30 views

Rewrite URL but have php read old URL

In my platform, each user has their own config file. The file is named by the subdomain they created. Example: user1.domain.com user2.domain.com user3.domain.com The system reads the url via $...
0
votes
0answers
8 views

.htaccess request_uri mismatch when at certain url

I use .htaccess to redirect unauthorized user when they visit a certain path, say www.domain.com/member/ In my rewrite rule, I have RewriteCond %{REQUEST_URI} !=/member/index.php which works ...
-1
votes
0answers
18 views

My website is being redirected to http automatically [on hold]

After I installed a standard godaddy SSL certificate, and even if I started my URL with https, the website will immediately and automatically redirected to the http version of my website. I tried to ...
0
votes
2answers
1k views

Enable Cross Origin Scripting on Nginx from retina.js to load files from another URL?

Im running a retina image plugin along with W3 Cache for CDN support. W3 cache moves images to S3, but the JS file won't server the files from there due to the difference in URL (it goes from h ttp://...
2
votes
1answer
3k views

How to exclude a sub-folder from HTaccess RewriteRule

I have WordPress installed in my root directory, for which a RewriteRule is in place. I need to password-protect a subfolder ("blue"), so I set the htaccess in that folder as such. Problem is that ...
0
votes
0answers
22 views

http redirects to https unless one page

I have this in my htaccess file, to redirect all http to https: RewriteEngine On RewriteBase / RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.sientemarruecos.viajes/$1 [R=301,L]...
0
votes
0answers
14 views

Move 2 subdomains without breaking links to themselves

Assume www.example.com contains two sub-domains, each with a different site, such that www.example.com/sub1 and www.example.com/sub2 are not related to each other. I want to move/rename sub1, but I ...
0
votes
1answer
25 views

What's the error in my HTACCESS

index page and profile page show 404 after htaccess redirection I transfered from bogger to wp.. redirected all links from year/month/postname.html to postname/ using these lines: # WPhtc: Begin ...
4
votes
1answer
4k views

Error headers: ap_headers_output_filter() after putting cache header in htaccess file

Receiving error: [debug] mod_headers.c(663): headers: ap_headers_output_filter() after I included this within the htaccess file: # 6 DAYS <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"...
0
votes
1answer
1k views

Apache .htaccess with mod_expires not working for certain directories

I have a Joomla site that I am trying to enable caching using mod_expires. I have the .htaccess in the root of the site and have added the options as found on the page http://www.pactsoftware.nl/...
0
votes
0answers
37 views

phpMyAdmin asks for BasicAuth

When accessing the phpMyAdmin link (mydomain.com/phpMyAdmin/), I am being prompted with a BasicAuth pop-up. The phpMyAdmin/config.inc.php does not overwrite any defaults, therefore the config.default....
0
votes
0answers
17 views

How to restrict access to docroot folder of glassfish server

Inside the docroot of the glassfishserver I have created a .htaccess file: AuthType Basic AuthName "aaa" AuthUserFile "C:\Users\user01\Desktop\.htpasswd" Require valid-user And on the desktop I ...
0
votes
1answer
237 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
0answers
8 views

How to redirect everything to https with www? [duplicate]

I am using the following code in my .htaccess file RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] It ...
0
votes
2answers
688 views

Apache 2 .htaccess matching all sub directories of current directory

I want to disable the php engine in all directories below the current one. I have tried using <Directory> and <DirectoryMatch> but cannot find the correct regex syntax for matching just ...
0
votes
2answers
94 views

apache2.conf write global redirect for all sites hosted on server

I have been trying to add rules like the following to the /etc/apache2/apache.conf file but they havent been noticed, whereas if I add them to the individual .htaccess files they are obeyed and anyone ...
0
votes
1answer
3k views

.htaccess Rewriting Tomcat Server

I am writing a website using Railo. My code is to be deployed on a Railo Server running on Tomcat, overlayed on a regular Apache+PHP server. I need to send all requests to http://subdomain.myserver....
11
votes
4answers
1k views

Load time impact of htaccess

There are in general two possibilities of handling stuff on Apache: make configurations for folders one by one using htaccess file to fully resign htaccess and put all the rules into the httpd.conf ...
3
votes
2answers
13k views

Convert and redirect URL in uppercase to lowercase using .htaccess

I would like redirect a URL with uppercase characters http://localhost/A/B to a lowercase version http://localhost/a/b using the .htaccess file. Using regex I can capture A and B but is it possible ...
0
votes
0answers
29 views

Apache htaccess rule to obfuscate a directory name?

How can I hide the true name of a directory using a .htaccess file and only allow access to it under a different path? Yes, this can be achieved by renaming the admin directory to something else, ...
0
votes
0answers
9 views

I want to rewrite the path with with htaccess [duplicate]

When I visit this link: http://user.demo.net/email@homepage.com/ It will be interpreted as follows: http://user.demo.net/data/email@homepage.com/ I tried this code but it appears the 505 error ...
0
votes
1answer
23 views

Apache Aliased Directory doesn't work for child directories of alias

I'm trying to run two different applications under user. Application 1: /home/user/public_html/app/public/ Application 2: /home/user/public_html/forum/ VirtualHost has the Server set to ...
-2
votes
0answers
20 views

Get Parameter to URL using nginx re-write

I'm trying rewrite my nginx to use http://domain.com/main instead of using http://domain.com/?page=main I've done: try_files $uri $uri/ /index.php?page=$uri; Returns blank page rewrite ^/(\w+)$ /...
-1
votes
1answer
55 views

How to Permanently redirect URLs based on conditions

everyone I will be very much grateful if anyone can help me with the correct .htaccess rules to permanently redirect all URLs that meet the criteria == domain.com/category/subcategory/123456-some-...
0
votes
2answers
30 views

Apache says it can't read htaccess file when accessing files under specific folder

For other folders, my .htaccess file works fine, but when I was trying to download files under files folder, I got an error saying You don't have permission to access /files/ on this server. Server ...
0
votes
0answers
8 views

htaccess on subdomain & query string

I have the following htaccess RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{HTTP_HOST} ^(.*).domain\.com RewriteRule ^(.*)$ index-merchant.php?id=%1 [NC,QSA] It can capture $_GET['...
1
vote
2answers
88 views

How have phpMyAdmin (with a Alias) with a virtual host subdomain of a different documentRoot

To increase security in my server I created an subdomain only for admin, like admin.domain.tld and usually i access phpmyadmin by going only at admin.domain.tld/mysqladmin as in config file: <...
1
vote
0answers
33 views

redirect subdomain of old domain to directory in new domain

I would like to redirect a subdomain of an old domain to a directory on a new domain. e.g. forum.old-domain.com should redirect to new-domain.com/forum The redirection from old-domain.com to www.new-...
0
votes
1answer
12 views

Can't view domain.com/stats page with Joomla .htaccess enabled

I always have to disable my .htaccess to be able to see my stats page located unrder my domain in /stats . What can I do to tell htaccess to ignore routing /stats? ## # @package Joomla # @...
2
votes
0answers
8 views

Move htaccess rules to apache configuration files

I'm running a website with Joomla on a dedicated server (Debian), and i've read that moving .htaccess rules to apache2 configuration files may result in a good performance improvement (Apache HTTP ...
0
votes
1answer
59 views

Apache access control — from allow/deny to require

I'm trying to move my Apache access control directives from the older Order, Allow, and Deny to the newer Require. Unfortunately, I'm unable to think a new way after having used the old way for so ...
0
votes
0answers
22 views

How to make a 301 Redirect before proxy?

I have apache in front of tomcat. I have this proxy settings: <IfModule mod_proxy.c> <Proxy *> Allow from 127.0.0.1 </Proxy> ProxyPreserveHost On ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$...
0
votes
0answers
15 views

How HTACCESS redirect using URL id content number range

I want redirect on range id content to a subdomain. For example: From id = 1 to 500 i want redirect to a subdomain oldcontent.example.com From id = 501 to 1000 i want redirect to a subdomain ...
0
votes
1answer
30 views

.htaccess file permissions changed

I have a weird problem on some of my servers with Directadmin and Wordpress installed. The file permissions of the .htaccess file are set to 444. When I change them back to 644, edit the file and save ...
2
votes
3answers
1k views

Server remembering old rewrite rules, even when I remove htaccess

I have set up a development server with Ubuntu and LAMP, but for some reason the .htaccess is acting strange... There is a site on there with a set of rules, when I comment them out they still work, ...