Tagged Questions

The htaccess file is a supplemental configuration file used by Apache to modify the default configuration as it applies to the directory the .htaccess file it in (as well as all the files in that directory). The most common use is in conjunction with the mod_rewrite and security modules of the ...

learn more… | top users | synonyms (1)

0
votes
1answer
16 views

Routing subdomains with querystrings

RewriteEngine on Options -Indexes DirectoryIndex index.php RewriteBase / RewriteRule ^user/([a-zA-Z]+)/([a-zA-Z]+)(/)?$ index.php?controller=main&function=$1&arguments=$2 [NC,L] I can go ...
1
vote
1answer
23 views

url rewrite to different domain

I have access to a folder on a web server in which I would like to put a .htaccess file to so that when a user visits www.somesite.com/myfolder/index.html they get shown the content of a page on ...
0
votes
1answer
21 views

Setting per-folder values for suhosin settings in .htaccess

I've set suhosin.perdir = 'p' in my ini file. I would now like to change suhosin ini settings on a per-folder basis. The following all work (running phpinfo() inside the desired folder shows the ...
0
votes
1answer
27 views

using .htaccess to block tor servers

I have a large list of tor servers, maybe 2,000+ servers that I would like to ban from registering accounts on my site. Is it viable to block the entire list I have in an .htaccess file or will this ...
1
vote
1answer
14 views

Rewrite directory names to php files with htaccess?

Basically folder etc has files: contact.php help.php news.php How can I make /etc/contact direct to /etc/contact.php?
1
vote
1answer
35 views

Why is .htaccess redirecting to `default.asp` and what it is?

This is the content of my .htaccess file: Options MultiViews Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www.lventas.com$ [NC] RewriteRule ^(.*)$ ...
0
votes
1answer
22 views

.htaccess and exact matches

I'm having trouble rewriting the following: mysite.com mysite.com/myproduct www.mysite.com www.mysite.com/myproduct to mysite.com/myproduct/ Whatever I tried, it was either missing rewrites or ...
0
votes
0answers
17 views

htaccess with loaclhost instead of URL?

I'm creating a replica of my server contents on an apache server in my PC to test new features and debug. I cannot make the htaccess file work correctly, I tried changing all appearances of ...
0
votes
0answers
30 views

Remote web in localhost: htaccess redirections

I have a web working in a remote server: www.example.com and I'm copying it to my localhost, Apache is installed on port 8082 so my local adress would be localhost:8082/example.com/. This is what the ...
0
votes
2answers
34 views

url redirection using .htaccess

As i have changed my dynamic urls to static urls. now i have one dynamic url which is already distributed to so many sites. as i dont want to loose traffic whenever anyone trying to access my dynamic ...
0
votes
3answers
34 views

Is it possible to use htaccess for samba user control?

I have a htaccess file named mypasswdw as user_a:encrypted_password_a user_b:encrypted_password_b And is it passible to use this file as samba password file? If then, how to write the smb.conf? I ...
0
votes
1answer
23 views

.htaccess - redirect non www to www and retain subdomains from redirecting

So, on my main domain 'domain.com' I created several subdomains from cPanel, like 'sub1.domain.com' and 'sub2.domain.com'. Their real location on server is in 'domain.com/sub1' and 'domain.com/sub2'. ...
0
votes
1answer
48 views

Set server root on a per folder basis

Assuming the following folders: / index.html /folder1/ index.html page.html (So, root with index.html and folder1 with index.html and page.html.) I want links in page.html pointing to "/" ...
1
vote
1answer
27 views

Accessing a directory with htaccess gives a 500 error

I have installed the Xamp server in my Windows machine. I have placed the follwing .htaccess file in a directory : # Original # If you modify this file then change the above line to: # Modified ...
0
votes
0answers
11 views

How to know which URL htaccess is pointing for debugging?

I'm trying to point htaccess to a certain directory, when it's pointing elsewhere I get: Not Found The requested document was not found on this server. Web Server at @domain_name@ I want to know ...
0
votes
1answer
23 views

When directory is not found add directory?

It should first check if the first /$1/ is a directory and if not add a directory before it. Examples: 1- pizza 2- pizza/olives Should rewerite the url to: 1- menu/pizza 2- menu/pizza/olives ...
1
vote
2answers
28 views

Cannot load IMG without specifying extension

I just moved to a new server. All my site is including images without extensions. () but the new server doesn't seem to recognize this files unless I add each file's extension which I don't know so I ...
-1
votes
0answers
23 views

Converting htaccess to lighttpd url.rewrite

In document root i've following .htaccess RewriteEngine on RewriteCond %{REQUEST_URI} !^/aaa/ RewriteRule (.*) /aaa/$1 [P] In /aaa/ dir there is a clean-url htaccess Please, help me to rewrite a ...
1
vote
1answer
21 views

mod_wsgi with no access to apache config

Provided that on the server I have: mod_wsgi loaded and enabled all-powerful htaccess, can I use mod_wsgi without the need to edit the global apache config files? I don't have administrative ...
2
votes
1answer
24 views

Redirecting paths to shebang through .htaccess?

I had a small bit of code that would redirect pages accessed from my own domain to their hash addresses, like so: example.com/stationary.html => example.com/#/stationary This was the code: ...
0
votes
1answer
18 views

.htaccess: Backreference in RewriteCond to check for file existence?

I'm trying to match URLs of this type: http://www.example.com/image/12345 I'd then like to check whether this file exists: http://www.example.com/files/image_12345.jpg If it does, I'd like to ...
0
votes
1answer
38 views

Access htaccess variable

I am using htaccess to block all access to our dev server with the following code: AuthType Basic AuthName "Auth" AuthUserFile /var/htpasswd Require valid-user Order allow,deny Satisfy any I have ...
-2
votes
1answer
68 views

.htaccess not working on my phpMyAdmin folder

I have a phpMyAdmin folder. So first I set .htaccess folder and type this in it. AuthUserFile /var/www/html/phpMyAdmin-3.4/.htpasswd AuthName "phpMyAdmin Login Page" AuthType Basic Require valid-user ...
1
vote
2answers
41 views

.htaccess : blocking proxy

so there is this guy spamming my phpBB2 forum since he's banned. He keeps coming back with proxies, and I would like to block them using my htaccess. My forum is located at http://www.site.com/forum/ ...
1
vote
2answers
65 views

Root only redirect using .htaccess

I have website content like mysite.com/index.php mysite.com/apps Now I want to put a maintenance page so people who will visit to mysite.com or mysite.com/index.php will able to see maintenance ...
0
votes
1answer
40 views

How can I have Apache display a static maintenance page for all but certain users?

I need to be able to put our site into maintenance mode, excepting certain users to allow for QA/Dev to be able to test changes to the site/database during the maintenance mode. The problem is that ...
0
votes
1answer
42 views

How Do I Set Up a Subdomain with a Separate Webhost and Domain Registrar?

I have looked at all sorts of solutions online and come up with nothing. I cannot ask the webhost for help because it's not my hosting account; I am setting it up for a client. My client has a ...
0
votes
2answers
48 views

Allowing access to joomla page for ip's in 'deny from'

I notice that my .htaccess file contains <Files 403.shtml> order allow,deny allow from all </Files> Which allows the 403 error page, 403.shtml, to be viewed by addresses that are ...
0
votes
0answers
12 views

htaccess redirect wordpress custom content type [closed]

Possible Duplicate: Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask? after reading a lot about this here ...
0
votes
1answer
25 views

Simple RewriteRule not working

I have the following url: http://www.mysite.com/test/index.php?topic=rules I want to rewrite it to: http://www.mysite.com/test/topic/rules I tried the following: Options +FollowSymLinks ...
2
votes
0answers
23 views

AWS ElasticBeanstalk for PHP is stripping the first slash off some requests

I've noticed that the leading slash gets stripped from requests and subsequently alters REQUEST_URI based routing lookups in my application. Is there either a way to disable this or documentation on ...
1
vote
2answers
32 views

Apache2 mod_rewrite possible bug?

I have a directory named 'foo' within my virtual host root. I am trying to intercept requests for a non-existent file also called 'foo' and rewrite them to a PHP file, the .htaccess file looks like: ...
5
votes
1answer
70 views

SSL redirect on EC2 instance behind SSL terminating load balancer

I'm trying to redirect all url's to https in a web application. I have an ec2 instance behind an elastic load balancer. SSL is terminated on the load balancer. Any attempts at redirection end up ...
1
vote
1answer
27 views

How to start Server user authentication in PHP and Apache?

I had a production server which used to authenticate user before granting access. I setup a new machine and copied files from the old server. Now, I can access pages fine, but it does not ask for ...
0
votes
1answer
13 views

301 Redirect issue when term in new and old URL

We are trying to create a set of 301 redirects where the exact string from the old URL is also present in the same position in the new URL. See the example below: Old URL ...
0
votes
0answers
17 views

using .htaccess to make a password protected directory; can't access it

I'm trying to do an installation of GeekLog on my personal server and I have run into some issues. In the installation guide I am told to place the public html files in my /www directory, and then ...
0
votes
4answers
28 views

directory structure on web server security

I have many directories in a application like root index.php modules/ includes/ data/ themes/ and etc. I have placed index html file in every folder to make it simple secure. But i think ...
0
votes
3answers
64 views

Bizarre Site Slowdown for Some Users with .htaccess Directive

To protect my website on a shared hosting plan, I added this to my .htaccess file: <Limit GET HEAD POST> order deny,allow deny from .ru deny from .cn deny from .in deny from .de deny from .cz ...
0
votes
3answers
48 views

www vs. non-www and subdirs with special .htaccess

In my root folder, the following captures https://example.org and http://example.org and redirects to its respective version (http or https) with the www added back in. (It's a requirement they had ...
0
votes
1answer
33 views

How can I create files from a .htaccess file?

I want to create files (and put HTML in them) only using a .htaccess file (before you flame me with questions about why on earth I'd like to do that: it's just for fun, for a hack, not for any real ...
0
votes
1answer
40 views

.htaccess RewriteRule works on addon domain but not root domain

I made a .htaccess in an addon domain, which successfully hides the wp-admin folder: # Hide wp-admin <ifModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_USER_AGENT} ...
0
votes
1answer
21 views

Updating the same .htaccess file on multiple sites

I manage 400+ wordpress blogs across 8 shared hosting accounts and I'm looking for a simple way to distribute changes to certain files. In particular, I want to push out the same .htaccess file to ...
0
votes
1answer
23 views

Redirecting URLs using htaccess & PHP?

I would like all the URLs of the following format: mysite.com/xyz to display: mysite.com/show.php?keyword=xyz How can I do this?
1
vote
1answer
79 views

svn “Connection reset by peer” error during commit .htaccess file

I can't commit .htaccess files only. When I am try to commit on terminal , I am getting this error: svn: PUT of '/svn_sr/!svn/wrk/2ce2c337-a371-411d-ae18-c39acaa2d846/trunk/crm/.htaccess': Could not ...
0
votes
1answer
31 views

htaccess redirect everything to example.com/index.htm

I want to redirect any request from one domain to another but not request the page on the new domain or pass parameters. The closest I got was: RedirectMatch permanent ^(.*)$ http://www.example.com ...
0
votes
0answers
54 views

Convert .htaccess from Apache to Nginx

i have this .htaccess configuration but I can't make it work with nginx. <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] ...
-3
votes
1answer
46 views

.htaccess user agents and website security

I have been looking around and trying to work out the best way to protect a few websites of mine. Appart from the obvious manual monitoring of the site logs and banning extreme/suspicious activity. I ...
-5
votes
1answer
33 views

Will Apache load and process .htaccess file during every request

... or there is an optimization which reduces operation cost to single stat() call in case file is unmodified? Please provide a reference link of some kind.
1
vote
1answer
49 views

server-status not working if allowoverride is set to all

in my apache config i have following settings <Directory "/opt/website/new-website-old/httpdocs"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from ...
0
votes
1answer
37 views

convert .htaccess to nginx

It's me again :( I was trying to install siwapp on my webserver but I couldn't make it work with nginx, here is the .htaccess file content: RewriteCond %{REQUEST_FILENAME} !index.php RewriteRule ...

1 2 3 4 5 21