Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

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
569 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
398 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
676 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
118 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
767 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
800 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
671 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
3k 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
194 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
306 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
353 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
671 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
328 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
745 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
886 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
513 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
2k 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
198 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
384 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
925 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
267 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 ...
0
votes
1answer
240 views

htaccess - “detect” url and redirect

Idea is: if URL = "http:/localhost/site/" else if URL = "http:/localhost/site" redirect to "http:/localhost/site/index.html" Can this be done with .htaccess / Apache mod_rewrite and how?
2
votes
3answers
4k views

.htaccess mod_rewrite 500 internal server error

Whenever I place my .htaccess file in my web directory I receive a 500 internal server error and within the error.log file specifying: [Sat Jan 21 13:46:07 2012] [error] [client xx.xx.xxx.xx] Request ...
0
votes
2answers
440 views

domain.com to www.domain.com .htaccess redirect working except one subdir

I've setup a redirect in .htaccess to consolidate domain.com to www.domain.com traffic on our Apache server. Looks like this: Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ...
2
votes
1answer
2k views

How do I make SEO friendly URLs from my PHP pages?

I'm pretty new to this and was wondering how to turn my site URLs into SEO friendly URLs using .htaccess and mod_rewrite? My URLs take the form mydomain.com/index.php?pid=1&pagename=Some Page I ...
1
vote
1answer
2k views

Access Forbidden! Apache Windows XP

This is a great tutorial on how to server websites other than in default htdocs folder in XAMPP. It worked for me the other day but then I had to reinstall XAMPP (1.7.7 was 1.7.6) and now I am getting ...
0
votes
2answers
2k views

.htaccess rule not working without HTTP redirect [R]

I am using the following .htaccess with Wordpress to remove index.php from the visible URL. This works but forces an http redirect so the URL changes in the browser window. If I remove the [R] it no ...
0
votes
1answer
383 views

subdomain to subdomain forward with masking

I want to forward with mask from one server to another server. In Server One: www.abc.com test.abc.com live.abc.com In Server Two: http://ipaddress.com/folder1 http://ipaddress.com/folder2 ...
0
votes
1answer
183 views

Stop searches showing tld domain sites appearing as subdirectory of main holding site domain?

I'm not sure if this is a problem specific to how my hosting is structured or not. Let's say the main domain for my account is maindomain.com (for purpose of discussion) I am building other sites, ...
0
votes
2answers
2k views

'ExpiresActive On' and 'ExpiresDefault “access”' in .htaccess make site disappear in WAMP

I'm working on a site locally within a folder with WAMP. When I add the following to my .htaccess file the folder is no longer viewable in WAMP. ExpiresActive On ExpiresDefault "access" I'm ...
1
vote
1answer
3k views

redirect using htaccess, if a url contains query string

I want to do permanent redirect using htaccess. For eg :- I want to redirect /modules/pages/?pageid=7 to http://www.xxx.com/aaa/. This is what i have done Redirect permanent /modules/pages/?pageid=7 ...
2
votes
2answers
397 views

Image Hot-links & Google's Instant Previews

I'm trying to adjust my site: 1. stop Image Hot-links 2. block Googlebot-Image (because I do not want my images to be searchable) 3. allow Google's Instant Previews I've tried this but the Instant ...
1
vote
2answers
2k views

.htaccess redirect to subfolder in different domain, maintaining old domain in the URL

Redirect has been widely discussed and most problems solved, so I am sorry for opening yet another post about this, but none of the codes I am trying work. I have a WordPress site hosted in ...
1
vote
2answers
3k views

How do I make SEO friendly URLs?

My url is: website.com/profile/?id=24 I want it to be: website.com/profile/kevinlee The ?id=24 will be replaced with the username of the id=24 in the database How do I convert it to that?
2
votes
1answer
366 views

Configuring directory access on a server. .htaccess and alternatives?

I have written a small PHP package/site-template (should I say). It contains a directory data/ that contains some important files that the users should not be able to see. These file should however ...