Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
1answer
2k views

.htaccess: allow from - using dynamic IP - defining the static portion of my IP?

I'm looking to secure my phpMyAdmin dir from being accessed from other IPs than my own, albeit dynamic IP, let's say it is 191.164.1.xxx (xxx = being dynamic numbers). Referring to the Apache ...
0
votes
1answer
484 views

How do I 301 redirect from the root folder to a sub folder while keeping the rest of the URL string intact

When I first launched my site, it I had MediaWiki in the root and a wordpress blog in a subfolder, /blog/. After a while spammers took over the MediaWiki site and I had to remove it. The problem is I ...
2
votes
2answers
423 views

301 Redirect exception vs. Script new connection to DB

I'll get right to it because this will be long. I've built a WordPress site for a client on a new domain name and 301 redirected his 3 other domains to point to it. Then, I learn that he has a ...
2
votes
1answer
392 views

zlib compression issues

I'm having some issues running zlib compression on my site .. Firstly if I enable zlib compression in .htaccess using: php_value output_handler ob_gzhandler then I receive thousands of lines of the ...
3
votes
1answer
683 views

Redirecting a .co domain to a .co.uk with masking

This is my first post here, so be gentle... A friend wanted a website and paid for one to be set up. For reasons unknown to me he ended up with hissite.co rather than hissite.co.uk, which is what ...
1
vote
1answer
666 views

Google sitemap access error, something to do with .htaccess redirect from http://www. to http://

I recently updated the htaccess of my site to redirect from http://www. to http://. It all works fine but now I've made some changes to my site and uploaded a new sitemap.xml to google webmaster. I'm ...
1
vote
2answers
3k views

.htaccess 301 Redirect Hash Tag Redirect

How do I do a .htaccess redirect that has a hash tag in it? Example Source: domain.com/#/subdir Target: newdomain.com/whatever/something Everything I've tried ignores the hash tag and either ...
1
vote
1answer
1k views

Restrict direct folder access via .htaccess except via specific links

I want to restrict access to a folder on my server so that visitors may only access the contents (a web application) via links in the same domain. Can I do this using .htaccess? To be clear, I simply ...
1
vote
2answers
2k views

.htaccess and browser caching

I ran across these suggested htaccess edits. Is this a good practice? Is this something I should implement on my wordpress site?: <IfModule mod_expires.c> ExpiresActive On ExpiresByType ...
2
votes
1answer
633 views

Htaccess - Rewrite png to php file

I currently use trans.png.php?id=1&campaign=test to track my newsletter campaigns. I want to use trans.png instead as it's the src of an img tag. How can i do this in htaccess? Also is there any ...
4
votes
2answers
2k views

How to write a generic .htaccess file rule, regarding RewriteBase

The following rule in my .htaccess works just fine for routing calls to index.php: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L] However, this does not ...
1
vote
2answers
202 views

Strange links appearing in 404 logs

I've recently been going through our 404 logs and we have a number of urls which look like this turning up:- ...
1
vote
1answer
123 views

Links don't work on new server

I've recently moved from server with php4 to php5. Now I cant open content in my page. Links look like this "page.com/news-it-is-rainy-day-1.html". But when I try to open link I just get the archive ...
1
vote
1answer
198 views

Website .htaccess file for Wordpress sub folder

I developed a Flash website for a client and added the following .htaccess file in the root directory and the non-www to www redirect works perfectly. RewriteEngine On RewriteCond %{HTTP_HOST} ...
11
votes
2answers
3k views

Can .htaccess slow down a site?

I'm working with a client on an e-commerce website. I implemented clean URLs using .htaccess. I also used .htaccess to solve canonical issues such as redirecting www to non-www and removing index.php ...
2
votes
1answer
588 views

htaccess preventing sqlite database being downloaded

I have a VPS, running apache2 on Debian 6. Created a file called .htaccess on the web root, which included: <Files ~ "\.db$"> Order allow,deny Deny from all </Files> ...
0
votes
2answers
401 views

htaccess and htpasswd trouble

This is the first time that I have ever tried working with .htpasswd and .htaccess files, so please point out my childish works. I have my apache document root set to /www/ on my debian server. ...
2
votes
1answer
2k views

.htaccess - lose the file .html extension

I'm having a bad .htaccess day! I want a user to be able to type the URL mysite.com/about instead of mysite.com/about.html On .htaccess file I have: RewriteEngine On RewriteCond ...
3
votes
1answer
700 views

RewriteRule working local but not on remote server

I have a .htaccess file with one simple RewriteRule: RewriteEngine on RewriteRule ^([A-Za-z0-9-]+)$ ?site=$1 I want to have an url like http://www.example.com/imprint and forward it to ...
1
vote
2answers
119 views

Full password not required to access password protected directory?

I password protected a directory in cPanel. When I went to access the page in my browser, I accidentally hit backspace on the password before I hit enter. Surprisingly, the page still loaded. I played ...
1
vote
2answers
1k views

Having mod_rewrite not rewrite requests for a particular directory

I have many forward rules written in my .htaccess file. However, for the requests to a certain directory and its subdirectory, say wordpress, I don't want to use the forward rules. RewriteEngine On ...
4
votes
2answers
776 views

Difference between “/” at end of URL and without “/” [duplicate]

Possible Duplicate: Does it make a difference if your url ends in a trailing slash or not? Why treat these as different URLs? I am doing a 301 redirect in my WP application using ...
3
votes
1answer
812 views

Rewrite img and link paths with htaccess and serve the file from rewritten path?

I have a static mockup page, which I want to "customize" by switching a variable used in image-src and link-href attributes. Paths will look like this: <img src="/some/where/VARIABLE/img/1.jpg" ...
3
votes
1answer
1k views

Will adding “www.” to my domain setting in Google Analytics impact already collected data?

I have a profile in Google Analytics (GA) that has been collecting data for a year. The domain setting in GA is "http://example.com". The site, however, will redirect any non-www request, to ...
2
votes
1answer
680 views

GoDaddy-Drupal Site down due to mysql password change, how to change it back?

PDOException: SQLSTATE[28000] [1045] Access denied for user 'lev1127301002684'@'188.121.41.131' (using password: YES) in lock_may_be_available() (line 167 of ...
2
votes
3answers
2k views

How to restrict site access to all countries except mine with .htaccess?

I used this tool to download list in ".htaccess allow" format to allow traffic from my country and restrict all others but it's still accessible when visiting from bunch of foreign proxies. I'm ...
4
votes
1answer
195 views

Do Dynamic Subdomains Harm SEO or not?

I am establishing a new website for just resumes, and I structured my htaccess as to provide dynamic subdomains as: marketing.resumedomain.org/index.html sales.resumedomain.org/index.html ...
1
vote
1answer
142 views

Which redirection needed for this in .htaccess? 301 and?

I have two cases, it is very hard for me to separate them. I see them as redirection -problem. # 1. I want to redirect all .*/feeds to mySite.com/feeds showing # the content of ...
0
votes
1answer
94 views

Website performance tips?

I'm kind of having some troubles with the loading of my website. It sometimes loads fast, then when you refresh it, most of the time, it will just keep trying to load images. It will keep doing that ...
0
votes
3answers
4k views

Restrict access to IP address range

I’m trying to restrict access to a web resource to the intranet of a company via .htaccess. Unfortunately, the approach via Allow from … isn’t working for me and and I don’t understand subnets well ...
0
votes
3answers
308 views

“Index of …” directory's files listing

On my courses we've got homework on site in folders such as: http://example.com/files/tasks1-edc34rtgfds http://example.com/files/tasks2-0bg454fgerg http://example.com/files/tasks3-h1dlkjiojo8 ... ...
3
votes
2answers
358 views

Create friendly looking URL's with mod rewrite

I want to make the pages on my site more search engine friendly by turning the query strings into meaningful looking page names. For example I have a page that is this: /search.php?c=18 I want it ...
1
vote
1answer
690 views

.htaccess issue (500 - Internal Server Error) error

I was trying to learn how to edit and make a .htaccess file using a tutorial found at corz.org, I copied an existing .htaccess file from another site on my localhost and pasted the following content ...
0
votes
2answers
552 views

Hacked .htaccess - Inconsistent Results

At present a large number of .htaccess files are being created in various website folders throughout the site. Current .htaccess files are also being modified to include the following (cleaned up) ...
1
vote
0answers
236 views

How to block domain access? [closed]

I'm studying AWStats in my server and I see no interesting domain access. How can I block it with htaccess or another solution
1
vote
2answers
336 views

.htaccess remove index.php/url/ from URL

.htaccess is not working. /index.php/user -- is working http://www.example.com/user is not working Current .htaccess file: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond ...
2
votes
1answer
763 views

How to redirect user into mobile website?

Hi how to redirect the user into mobile site when the user accessing from mobile. Say example i have site called www.mysite.com. Now, a person accessing a website from mobile it should redirect to ...
3
votes
1answer
910 views

Apache show file index as utf-8

I'm on a shared hosting which runs Apache on a Windows server. I am running Linux and I have uploaded some files that should be accessible directly via a public URL (that is known only by a few ...
2
votes
3answers
521 views

Displaying a “coming soon” image to users whilst I work on website redevelopment [duplicate]

Possible Duplicate: 301 redirects for all except me I've been developing a new version of my website for a while now, on a different directory to my currently-live website. Shortly I'll be ...
3
votes
1answer
1k views

How do I create a .htaccess file that would make my website work like Adfly

I need, but don't know how to make, an htaccess file that will send a user, when looking for the home page, to index.php. It should not send them anywhere when they look for a URL like /7fg4/. ...
2
votes
2answers
2k views

How to manage multiple domains on same server

I have more than one (4 to be exact) domains and only one server host with same ip. How I can run all my domains from same server. All websites are wordpress sites.
1
vote
1answer
91 views

Apache2 “pseudo” doc root

I have several folders in my /www folder that contain various applications. To keep things organized, I keep them in their own folders -- this includes my base application. Examples: phpmyadmin = ...
2
votes
1answer
1k views

Subfolder non-www redirect

Is there a way to redirect a sub folder to no-www? What I use is: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] but this only ...
1
vote
2answers
2k views

htaccess 301 redirect subdirectory one level deeper - why is this not working?

it is probably a stupid question, but I have real troubles figuring out, how to redirect /products to /products/item It is a simple redirect, no regex needed. The toplevel site /products should just ...
4
votes
2answers
575 views

Redirecting URLs when launching a new website - how to avoid dropping page rank

i have over 100 urls in my website which i need to redirect: E.g. /page/how-to-bake-chocolate-cookies/ will redirect to /cookies/how-to-bake-chocolate-cookies/ /page/contact/ will redirect to ...
4
votes
3answers
1k views

How do I block US users from my website without interfering with SEO?

My website uses Apache 2.2.14 (which forwards all requests to Tomcat underneath). I need to block all US users from accessing the website (and potentially users from other countries). But importantly ...
1
vote
1answer
199 views

WordPress redirection chaos

I have a problem regarding redirection. It started out as I noticed, my non-www version is redirected to the www version by 302 redirect. Since then, I am trying to figure out why this is happening. ...
3
votes
1answer
393 views

Redirecting from a dynamic URL to a prettier/simple URL?

I am trying to redirect a page via my .htaccess, but it does not seem to be working. Old page: /dyn/?q=customer%20reference&f=1,1,1,1,1,1&c=10,10,10,10,10,10&s=1,1,1,1,1,1,1&st=1 New ...
5
votes
2answers
937 views

302 Redirect causes garbage at end of Wordpress link in Facebook

When I try to link my Wordpress blog to Facebook, the url doesn't resolve properly. There's garbage appended at the end and Facebook is not able to retrieve information from the site. Happens in ...
1
vote
1answer
269 views

Apache: use `foo.html` in preference to `foo/` when both exist

How to get Apache 2.2 to use foo.html in preference to foo/ when both exist? I'm moving a site from dynamic php to static html, while retaining the domain name. I've created a temporary mirror using ...