Tagged Questions

Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
2answers
1k 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
298 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
31 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
656 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
85 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
60 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
264 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
111 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
227 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
92 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
35 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
262 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
176 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
29 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
66 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 ...
0
votes
0answers
41 views

Custom rewrite rule - migationg to WordPress CMS

I am trying to move my image gallery site from one CMS to Wordpress. On current CMS I have page with medium size image on it with URL: ...
0
votes
1answer
82 views

htaccess: Only allow file access via the complete path, not the rewritten one

In my setup i have my CMS reside in a subfolder /sub and i rewrite all the access to the root to this subfolder: ## Rewrite www.example.com to the CMS home page: www.example.com/corporate/index.php ...
0
votes
0answers
74 views

GZIP compression for merged and specific files

My Website is using a CMS (Typo3) that has the feature to merge and compress all JavaScript and CSS Files. With htaccess i also enable the server side gzip feature which will work fine. But it seems ...
2
votes
2answers
872 views

Block bots by their Java referrer or User-Agent string?

I have been getting a lot of web hits in my logs that crawl most top level pages of my site and show a referrer as a Java version. I see different variants of the Java versions in the referrer, i.e. ...
3
votes
3answers
71 views

Does high traffic on HTACCESS affect the server?

i have a website and a sub domain.. the main website is hosted in server A and its sub domain in server B.. main website = server A sub domain = server B when i have high traffic i will ...
0
votes
1answer
151 views

Converting Drupal Boost .htaccess to Nginx

I'm trying to install Boost module to work with nginx. As we know Boost does not generate nginx directives just like Apache. Boost has the following directives for Apache's .htaccess: ### BOOST ...
0
votes
2answers
90 views

getting started with apache mod_rewrite on a virtual host [duplicate]

hey SO I am attempting to use apache's mod_rewrite module to do some basic rewrting of url on my website so they become a little more seo friendly basically I have a virtual host file that look ...
0
votes
3answers
71 views

Apache URL resolution - serve html file as directory

I've changed my web hosting provider and now I have a configuration problem: In the root of my site, I have a file called beta.html. The Apache configuration on previous webhost would serve its ...
0
votes
1answer
525 views

use .htaccess to change the url example.com/mobile to m.example.com

I have am setting up a social network script, it has both a desktop and a mobile version of the site. When a mobile device tries to browse the site, the mobile page is served with the url ...
0
votes
1answer
206 views

Permanently Redirect Subfolder Blog to Subdomain on Another Server

Seems this server redirect question may be better suited for serverfault than wordpress stack exchange. Originally we had a static marketing site at example.com and the wordpress blog hosted at ...
1
vote
1answer
48 views

RewriteRule preserving path across environments [duplicate]

I'm trying to come up with some redirect rules that'll work on my local working directory and production. The problem being my local dev env works via "localhost/exp" where as the production works ...
1
vote
1answer
42 views

How to change the document roots of multiple parked domain names?

I was able to change the document root of one of my parked domain name using the method described here: Change the document root of a parked domain? by rutiolma. Although, when I tried adding another ...
0
votes
1answer
24 views

Redirect issue: folders and files not redirected properly

I have recently set a new URL http://www.mytechnotes.biz for a blog I was maintaining on a subdomain http://technotes.tostaky.biz. The redirection works in the following cases: ...
0
votes
1answer
94 views

“Allow from” remote hostname works but not when using SetEnvIf in .htaccess

In .htaccess, I am trying to restrict access by remote hostname, e.g. requests coming from googlebot.com. I have found the following works: Order Deny,Allow Deny from All Allow from googlebot.com ...
1
vote
0answers
77 views

Request exceeded the limit of 100 internal redirects due to probable configuration error

This error only seems to happen to a few pages. Others will load just fine, some slower, but others will error out: # BEGIN WPSuperCache <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / ...
0
votes
1answer
125 views

Trouble converting .htaccess rewrite rules for nginx

Hi all I am trying to convert the following .htaccess code <IfModule mod_rewrite.c> Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
0
votes
1answer
41 views

.htaccess rule to change hosts for SEO

I want to migrate one of my client's website from a free host to paid host. Currently, the site/domain is being hosted inside a sub-folder (used this tut: https://my.bluehost.com/cgi/help/347) at the ...
0
votes
0answers
156 views

htaccess redirect affects bingbot, returning Redirection limit reached

Inside my .htaccess file, I have the following script: RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] <IfModule mod_rewrite.c> ...
1
vote
1answer
155 views

Apache: ExpiresByType per directory?

I have a folder with javascript files that should expire faster than the normal scripts. Is it possible to let files expire per directory using Apache 2 other than .htaccess? <IfModule ...
1
vote
0answers
129 views

Limit file access/download by count in Apache

I'd like to limit the number of times a file/image can downloaded/viewed to an upper count. For example if I have an image called /Limited.jpg and I wish that it can be downloaded/viewed only 1500 ...
0
votes
0answers
36 views

htaccess works fine on local but differently on remote

Hi I have an htaccess working fine on my local machine but when i upload it to my remote machine it works differently. RewriteEngine on RewriteCond %{REQUEST_URI} ...
0
votes
1answer
37 views

Rewrite a directory to another directory without a redirect [duplicate]

I have the following rewrite rule: RewriteRule ^support/(.*)$ /blog/support/$1 [R=301,NC,L] However, all it does is a simple redirect. What I want to is for /support to show the contents of ...
0
votes
0answers
102 views

Enable gzip for source maps

I'm using the Grunt plugins to concat, minify and generate source maps of my Javascript before I push it to the production server (I'll soon be doing the same with SASS for CSS). The source maps ...
0
votes
1answer
231 views

Apache Tomcat directory access, restricted and accessible only by web application

I have a Grails app. I want to move out all the images users upload to a directory outside of my web-app directory, somewhere else on the disk. Then I want to allow my application to serve them on ...
0
votes
0answers
258 views

How to convert this .htaccess to Lighttpd?

I converted .htaccess below to Lighttpd but it doesn't work. What mistake did I make? You can find original .htaccess below, and the file I converted below it. Original .htaccess: RewriteEngine On ...
0
votes
0answers
179 views

redmine in subfolder issue (Apache, mod_passenger, Ruby + Drupal site in main folder)

I have Redmine in subfolder /var/www/redmine and Drupal in folder /var/www/ When I go to URL mysite.com/redmine, Redmine shows ok, but mysite.com/redmine/login is (over)handled by Drupal. Apache ...
2
votes
1answer
145 views

I'm getting 500s while LIMIT / block http POST request w/ Apache(

I'm trying to use core - Apache HTTP Server's <LIMIT> Directive to limit spamers from doing POST's to my website(s): <Limit POST> Order deny,allow Include ...
-1
votes
2answers
1k views

Apache .htaccess error: 'not allowed here' on Debian Wheezy

I am trying to configure an apache virtualhost which needs to be password protected in the root directory. So I created a .htpasswd file (with sha passwords) and configured the .htaccess file. ...
1
vote
4answers
230 views

HTTPS / HTTP mod_rewrite rules, strange interaction with subsequent CMS index.php rewrite

With the below rewrites in htaccess, as expected, this HTTPS request is not rewritten: https://example.com/system/anything is not re-written to http://example.com/system/anything But, ...
2
votes
1answer
600 views

.htaccess not working on Cent Os 6.4

I have installed Cent Os 6.4 -Final Version and set the environment for PHP web development. My application uses the .htaccess for url rewrite & denying direct access of files. my configuration ...
0
votes
1answer
71 views

Order that Apache handles .htaccess directives

I was working on a WordPress site yesterday, mostly in a Web Performance Optimization capacity (on shared hosting). At one point I noticed that my .htaccess file had redundant, possibly ...
0
votes
1answer
89 views

Redirect specific IP using htaccess [duplicate]

I am trying to figure out if it is possible to do a 301 redirect for a particular IP address (in this case brute force password bot). I want to send this guy to a project honeypot link rather than ...
1
vote
1answer
42 views

Apache server password file (htpasswd) encoding

I use .htaccess, basic authentication and a corresponding password file to secure my web-space. The hosting is Linux / Apache. I want to support a user name with French accents (ie. not ASCII). ...
2
votes
1answer
218 views

Force HTTPS w/ Load Balancer and without (.htaccess rewrite)

I have the following code as a rewrite rule. RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L] This ...
1
vote
2answers
228 views

Apache2 mod_rewrite failing for non-existent sub directories [duplicate]

An even shorter version of my .htaccess file (Last RewriteCond wasn't there) use to work perfectly on my shared web hosting but I've moved to a VPS with Ubuntu 12 with it's stock Apache2 but it simply ...