Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [htaccess]

The hypertext access web server configuration file used for overriding configuration on a per-directory basis.

1
vote
1answer
306 views

How to send an alert when a user logs in via .htaccess?

We have vendors working remotely on our server and would like to know when they are accessing the development. It is accessible behind a username/password provided by .htaccess. How could I detect ...
1
vote
1answer
1k views

CentOS 5, cannot accept htaccess

I have problem with htaccess on my vps.I installed CentOS 5, uploaded site on /var/www/html and it works.But, htaccess isn't working.I tried to add AllowOverride All in httpd.conf, also uncomment ...
1
vote
1answer
219 views

.htaccess in subdir gets ignored by Wordpress' own .htaccess in /

I have a Wordpress installation on the root of an apache (I.E. on /) and WP wrote this custom .htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] ...
0
votes
1answer
19 views

Redirect Non WWW to WWW - htaccess placed in sub-folder

I am working on a site which has .htaccess file in root. There is a folder named babynames. This folder also has .htaccess file. I need the code to redirect from NON WWW to WWW for this folder. ...
0
votes
1answer
41 views

Apache 2.4 'require host not' works but gives repeated AH01753 [authz_host:error] in apache error log

Something is bothering me after my hosting provider went from Apache 2.2 to Apache 2.4. I had these Apache 2.2 rules in my .htaccess order allow,deny deny from domain.tld deny from 1.2.3.4 ...
0
votes
1answer
48 views

How to use Webstorm's local server with a .htaccess file to show pages without .html

I have configured the .htaccess file as per this StackOverflow article. I am now wondering how I get the same functionality for Webstorm as I have setup my links such that they don't have '.html' at ...
0
votes
1answer
116 views

Removing lingering end string after RewriteRule

I've tried everything but just can't seem to get things right :( I have over 800 urls and I need to rewrite them to point to a simple pdf file. Currently, I have links to: http://subdomain.mydomain....
0
votes
1answer
19 views

Redirect links using .htaccess file

I have a site with a lot of links that look like /click.php_id=602_from=139_to=42_url=1.html. I'd like to setup a redirect using .htaccess file(s) to have links that look like /click.php?id=602&...
0
votes
1answer
73 views

Browser displays Apache Test page when accessing website with a domain name I have just registered

My website is deployed on Tomcat which in turn in deployed on Ubuntu server. While developing the website I access it using server IP address like xxx.xxx.xxx.xxx:8080:/yyyy. Now I have bought a ...
0
votes
1answer
2k views

Howto change the port in an URL using .htaccess

Using .htaccess, I need to change any URL of this kind https://example.com:80/webtrees/anything_else by exactly the same, but with 443 instead of 80 Note that I already have this in my .htaccess (it ...
0
votes
1answer
9 views

utilize htaccess to rewrite all indexes

upon a 404 I want to set my htaccess file to utilize another file from another location in lieu of the missing file. The url must remain the same as if the file was in the directory & more ...
0
votes
1answer
256 views

Redirecting visitor with htaccess to another URL based on IP range

I've pored through other questions to find a solution, and the closest I've come is Zerobinary99's question here: How do regular expressions work in htaccess to redirect an IP range However, I'm not ...
0
votes
1answer
76 views

My .htaccess is not working properly

This is very bizarre. I have never had this issue until now. Basically I have a little code in .htaccess that removes the .php extension from the web pages. For some reason, it has stopped ...
0
votes
1answer
783 views

Allow PHP to execute in a specific subdirectory, when parent directory is denied?

I operate a small shared server and would like to give some of my users the ability to execute PHP code from the browser (but not all of them) but have been unable to do so. In the top level ...
0
votes
1answer
27 views

.htaccess mask on current website

I've got a website on a FTP, mysite, on which I have : /index.php which is my real site /preprod/index.php, which is my pre-production website I want to make the preprod website visible to any ...
0
votes
1answer
779 views

XAMPP Apache error AH01599: Cannot get media type from 'x-httpd-php53'

I'm trying to setup Xampp on a Mac (OSX 10.10.2), its setup and normal PHP runs, however when I try and run a Wordpress site the PHP code doesn't execute, it just prints out in the browser and I keep ...
0
votes
1answer
46 views

In SVN + Apache, how to password protect old revisions?

We have a svn repository, facaded by apache, and protected by (complex) authorizations. At revision 1000, we are migrating lots of folders in that svn to a new structure. We thus adapt the rights to ...
0
votes
1answer
169 views

Show The Same Content For Different URL Strings

I am trying to set up a system where for one of my directories, "example.com/folder/", if a user types in ".../folder/?(RANDOM STRING)", it will display the content for ".../folder/" but keep ".../...
0
votes
1answer
2k views

rewrite url in address bar without changing the actual url

Im facing SEO problem with my website cause my urls are with index.php for an example when i try to upload a file the url is like this 1 -http://niresh12495.com/index.php?app=downloads and when i ...
0
votes
1answer
133 views

mod_deflate - possible to compress 1k or higher only? cache?

Is there a way to tell mod_deflate in .htaccess to only compress files if they are at least 1kb? Also, can it cache compression results? Once it compresses a file, I want it to use that again instead ...
0
votes
1answer
2k views

HTACCESS - Server 404 for “deny from” instead of 403

Is there a way to server 404 instead of 403 when matched with "deny from"? For example: <Files *> order deny,allow deny from 127.0.0.1 </Files> This will normally server a 403. But I ...
0
votes
1answer
954 views

.htaccess and .htpasswd throwing 500 internal server error

I've created a .htaccess and a .htpasswd file, both using my hosting's tool, uploaded them, and I get an error when I try to view the directory. Why? my .htaccess file: AuthName "Restricted Area" ...
0
votes
1answer
24 views

How can I create a filter defining which invisible files to un-hide?

I want to expose .htaccess is the OSX GUI UI, but not other files that should be "invisible." Any ideas?
0
votes
1answer
246 views

.htaccess speed vs. symlink or DNS setting I don't know about?

This is probably a very simple question, but there's so much content out there that it was hard to google the correct problem I have. I have 3 domains that I all want to go the very same place, ...
4
votes
0answers
2k views

Redirect all HTTP traffic to HTTPS including subdomains

I'm trying to redirect all HTTP traffic to HTTPS including subdomains. I have the domain setup with FastComet on their Shared Hosting using cPanel. Some examples of how I like to redirect. http://www....
4
votes
0answers
521 views

why Safari always GET status 200, never 304 for my .swf file?

I serve a Flash app as a .swf file (with HTML wrapper file), and Safari always retrieves with GET status = 200, never 304. Thus, Safari never uses cache for this file and downloads it each time (it's ...
2
votes
0answers
54 views

How to have .htaccess inherit defines from httpd.conf

I defined a path variable in my httpd.conf: Define OOSPATH D:/oos This define can be used anywhere in the httpd.conf or files which are included from there. The same path needs to be used in a ...
2
votes
0answers
151 views

Keeping Firefox from adding “.html” to url

I've been messing with .htaccess for a while, and have the following rule: RewriteRule ^(mypage|myotherpage)/?$ main.php?p=$1 [L,QSA] If I enter http://mydomain.com/mypage/, it displays main.php as ...
1
vote
0answers
110 views

redirect subdirectory requests to alternate server:port

I'm using the following .htaccess to redirect requests to domain root ( http://example.com ) in apache to an alternate webserver on the same host listening on an alternate port ( http://example.com:...
1
vote
0answers
674 views

Redirect multiple domains and subdomain with .htaccess

I am struggling with setting proper https redirect via a .htaccess file for my domains. I have the following domains, subdomains and directories: public_html/ -> www.red.com public_html/drk -&...
1
vote
0answers
471 views

How to define parameters/constants in Apache .htaccess files

I don’t have access to the Apache server configuration files and can only influence the configuration through .htaccess files. Unfortunately, this rather limits some things one might want to do. For ...
1
vote
0answers
131 views

Cannot load mod_rewrite Apache module

I am trying to use mod_rewrite module of Apache24 server, but I am not being able to load it. I know there have been many questions asked regarding this topic and I have gone through all of them but ...
1
vote
0answers
347 views

How to fix AddType or AddHandler problems

I recently moved from an old Godaddy hosting account to a new Godaddy Cpanel hosting account. The menus on the website are generated by using php include statements which worked on the old hosting ...
1
vote
0answers
323 views

Deploying web.py project to Bluehost, WSGIServer: missing FastCGI error

I'm trying to deploy a very simple web.py app to my Bluehost website using these instructions. Here's my main python file: #!/usr/bin/python import web from web import form import whitelistchecker ...
1
vote
0answers
191 views

Rewrite without url changing

I would like to redirect (without url changing) from mysite.com/order/business to mysite.com/order/index.php?tariff=business I have this .htaccess: Options +FollowSymLinks RewriteEngine on ...
1
vote
0answers
436 views

Make static site from wordpress site using bash

I have tried a few other scripts that can make a static version of a wordpress site but none of them are designed for bulk sites and I haven't found any that will just serve a static version while ...
1
vote
0answers
289 views

Chrome htaccess cache not enabled

When I go to an internal website using Chrome, I have to enter htaccess login credentials. However, in Firefox, when the htaccess login popup appears, the credentials are already filled in (obfuscated ...
1
vote
0answers
336 views

mod-rewrite rule not working properly for files in sub directories

I'm using the following rewrite url to get prettier urls: RewriteRule (\d+)/(.+) $2?companyId=$1 [NC,L,B,QSA,NE] The url /invoices.php?companyId=123 can for example be expressed as /123/invoices....
1
vote
0answers
2k views

403 Forbidden Acces via .htaccess clean url but can be accessed directly

Could someone help me decode my apache2 error_log? [Sat Nov 19 17:39:59 2011] [error] [client ::1] client denied by server configuration: /Library/WebServer/Documents/Users [Sat Nov 19 17:39:59 2011] ...
1
vote
0answers
360 views

How Does One Make Apache htaccess 301 Redirects Absolute?

I am trying to redirect my university webpage with an .htaccess file: Redirect 301 /~foo/ http://mynewdomain.com/ However, instead of taking me to http://mynewdomain.com , it appends the ~foo so ...
0
votes
0answers
15 views

Sending login credentials for .htaccess

Implementing an .htaccess login is easy, but how do you have users securely send their preferred credentials to you? Right now I have the user email me the output from this tool, but it only prevents ...
0
votes
0answers
22 views

How to allow Options +Index in a .htaccess?

Is it possible to allow Options +Indexes in a .htaccess only for a valid-user ? I would like to mix in a same command: Require valid-user Options +Indexes
0
votes
0answers
56 views

What htaccess rules will REMOVE the subdirectory serving the site from the URI (404 if included) & internal links?

**SEE UPDATE BELOW***** My primary domain site is to be served from a subdirectory on my server that is named same as the domain, so that will probably be confusing to read in this messy block of my ...
0
votes
0answers
13 views

.htaccess SSL enabled in :root vs /web dir

My website has SSL connection enabled in .htaccess in /web dir but I'm still not sure, if declaring SSL type connection directly in :root .htaccess would help my site be more secure. Of course my main ...
0
votes
0answers
185 views

Possible .HTACCESS Issue

I am running a youtube clone script on a local install of XAMPP via a windows 7 machine. After installation I am able to see the home page but if I navigate to any other page either by link or direct ...
0
votes
0answers
52 views

How to redirect url in htaccess with regex?

My url is changing and for example now it is ..safety-bathroom then is changing to safety-bathroom-1 and so on, to avoid daily changing rule in htaccess I would like to have a rule which will do ...
0
votes
0answers
146 views

always 404 error on website because of .htaccess file

I hope someone can help me. I have the issue that my .htaccess files does not work. Because if I upload the htaccess file, then my websites (2 domains = 1 server) are down / offline and I can only ...
0
votes
0answers
110 views

.htaccess in root directory

I have an apache webserver (shared hosting) where I have access to /home/user If I place a .htaccess in /home/user it gets applied to all subdirectories. The domain belonging to this has several ...
0
votes
0answers
65 views

What is wrong with my .htaccess 404 error

I have created .htaccess under my public_html folder and it is like this: ErrorDocument 404 /404.php if I type mydomain.com/random it shows the 404 error, however if I add anything else, like ...
0
votes
0answers
147 views

Trouble handling zip files?

I'm trying to send a zip file to someone, but I'm having a lot more trouble with it than I should. I tried uploading it to 4shared, mediafire, and megaupload, but all uploads failed multiple times. I'...