Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

3
votes
1answer
125 views

JS and CSS caching issue: possibly .htaccess related

I've been using the HTML5 Boilerplate for some web projects for a while now and have noticed the following issue cropping up on some sites. My CSS and JS files, when loaded by the browser, are being ...
3
votes
2answers
426 views

RewriteRule not working for certain URLs

There are a few domains pointing towards the same server, and of course I need them all redirect to only one of them. Redirects work, but only for certain URLs. What works: http://www.domain.com, ...
3
votes
2answers
2k views

Share on Facebook does not show thumbnail images

I have a PHP application which has a "Share on Facebook" button that, On the development server shows the thumbnail images correctly and allows the user to select between them On the live server, it ...
3
votes
3answers
717 views

Will googlebot index my index.php even with an htaccess redirect?

Using a redirect statement in my htaccess file, people who type the following into the address bar... http://example.com/index.php ...are redirected to... http://example.com/ I also have a ...
3
votes
1answer
874 views

Clean URLs without PHP file extension

I want to make my URLs clean, for example: http://sample.com/about-me instead of: http://sample.com/about-me.php This is my code: RewriteEngine On RewriteBase / RewriteCond ...
3
votes
1answer
240 views

Blocking pages from being crawled with specific URL encoded parameters

While seeing the Google Webmaster Tools report there are certain URL encoded parameters like %5c and %22 coming up in URL's of site. We tried to identify the issue and observed that due to incorrect ...
3
votes
1answer
105 views

URL not found after rewrite

Using this .htaccess file: Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteRule matches/(.*)-v-(.*) matches/matchevent.php?event=$1%20v%20$2 [R=301,L] This url: ...
3
votes
1answer
732 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" ...
3
votes
1answer
414 views

Force fresh content, not from the browser cache

I used the following code in the htaccess to put my site under maintenance and show the visitors maintenance.html. Options +FollowSymlinks RewriteEngine on RewriteCond %{REQUEST_URI} ...
3
votes
2answers
358 views

301 redirect to 404 page?

Currently i'm migrating www. prefix from my urls and use htaccess to do the job. Since we have new software and cleaned database some of the old urls doesnt exists anymore. Therefore some requests ...
3
votes
2answers
227 views

How do sites avoid SEO issues and legalities with subdomain unique ids?

I was looking through a few websites recently and noticed a trend I'm not sure I understand. Sites are creating unique referral URLs for customers in the form of: http://customname.site.com (If ...
3
votes
1answer
188 views

Subdomain In Addon Domain Is Not Working

I added a new addon domain to my cPanel hosting. With the new added addon domain, I try to make some subdomain of it. But, the subdomain is not working like subfolder does. This is my situation: ...
3
votes
1answer
446 views

Proper caching method with .htaccess [duplicate]

Possible Duplicate: .htaccess and browser caching There are a lot of snippets that enable caching on a website and I don't know which one should I use. The most popular is something like ...
3
votes
1answer
519 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 ...
3
votes
1answer
626 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 ...
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/. ...
3
votes
1answer
293 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 ...
3
votes
1answer
165 views

Looking for a step by step guide to URL re-writing with mod_rewrite and other methods

I'm looking for step by step resource about how to rewrite URLs and have a few specific questions. I've read the documentation on mod_rewrite in Apache, but I still find myself a little lost. If ...
3
votes
2answers
428 views

How do I redirect an English language URL to an Arabic language URL?

I have a link that's currently formatted like this: http://site.com/news/view/1.html I want to it redirect it to: http://site.com/خبر/عنوان-الخبر where خبر is equal to news and عنوان-الخبر is ...
3
votes
1answer
1k views

Can I enable GZIP on Godaddy?

One of my sites lives on GoDaddy's bottom-of-the-line cheap hosting, I have the correct code in my .htaccess file, but it's not compressing because mod_deflate is not loaded. How do I enable that? ...
3
votes
2answers
177 views

Using .htaccess for proper indexing/SEO of timthumb images

I don't know a whole lot about the intricacies of SEO so I was wondering if someone here could provide some insight to this problem. When you use the php script timthumb on a website, it means images ...
3
votes
1answer
1k views

In Joomla In htaccess REQUEST_URI is always returning index.php instead of SEF URL

I have installed joomsef version 3.9.9 with the Joomla 1.5.25. Now I want to set https for some of the section of my site(e.g URI starts with /events/) while wanting rest of all urls on http.I am ...
3
votes
2answers
752 views

Apache RewriteRule not redirecting

I have this in my .htaccess file: RewriteEngine on RewriteRule ^images/chart\.png$ /static/images/chart.png [L,R=301] RewriteRule ^images/artwork/(.+).png /static/artwork/$1.jpg [L,R=301] ...
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 ...
2
votes
2answers
4k views

htaccess execution order and priority

Can anyone explain to me in what order apache executes .htaccess files residing in different levels of the same path and how the rewrite rules therein are prioritized? For example, why doesn't the ...
2
votes
2answers
2k views

Use .htaccess to rewrite requests for a PNG as a PHP GET variable

I'm REALLY bad with .htaccess files, and reading through the existing questions on SO only confuse me more (mainly because they're all situation-specific and don't exactly apply to my situation at ...
2
votes
2answers
135 views

Replacing an existing website – SEO considerations for broken links?

I have built a new website to replace a client's existing company website on the same URL. The content is entirely different, and none of the page links are the same. Do I have any issues to worry ...
2
votes
3answers
514 views

How to remove /index.html

How to make redirect /index.html -> / in Apache? Redirect /index.html http://domain-name.com/ Is causeing infinite loop when opening home page.
2
votes
3answers
2k views

.htaccess - if the file doesn't exist, rewrite to index.php but send 404 instead of 200

I have a catchall .htaccess directive like this: RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.*)$ index.php [L] Anything that doesn't exist and the URL is ...
2
votes
1answer
88 views

What's the “^” in RewriteRule Statements?

I keep seeing the ^ character in RewriteRule statements in a context that doesn't fit with the usage specified here. For example: RewriteRule ^(.*)$ $1.php [L,QSA] What does it signify?
2
votes
1answer
988 views

Multilingual and SEO URLs - best practice?

What would you recommend as a URL structure for setting up a multilingual site when optimizing for SEO? I'm thinking: www.yoursite.com/en/some-category/some-article/ ...
2
votes
3answers
1k views

mod_rewrite works within directory not on root

I am having a problem with my RewriteRule for the querystring portion. What I am able to debug is that the rule is being triggered at least because the page "tags.php" is being rendered but without ...
2
votes
2answers
13k views

How to set suhosin.post.max_vars in a htaccess file

I need to add this values to my htaccess: suhosin.request.max_vars = 8000 suhosin.post.max_vars = 8000 If I just add them like that I get an Internal Server Error Which is the right way to ...
2
votes
3answers
437 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 ...
2
votes
2answers
213 views

Can you rewrite the root?

Not sure how to word this one but will explain most I can. I am trying to make the following happen. Re-write this http://domain.name To this http://domain.name/home/ Is it possible ? update ...
2
votes
2answers
3k views

Mod Rewrite - directing HTTP/HTTPS traffic to the appropriate virtual hosts

I have an Apache2 web server (v. 2.2.16) running on Debian hosting three virtual hosts. The first two hosts are HTTP only (server1 and server2). The last host is HTTPS only (server3). My virtual host ...
2
votes
1answer
1k views

What is redirecting mobile visitors to our website?

Our site may have been hacked. It loads okay on desktop browsers, but on mobile devices it redirects to a porn site. I can't see anything in the source code or .htaccess which would be causing this. ...
2
votes
2answers
4k views

How can I fix the #c3284d# malvertising hack on my website?

For the past couple of weeks at semi regular intervals, this website has had the #c3284d# malware code inserted into some of its .php files. Also the .htaccess file had its equivelant code inserted. I ...
2
votes
1answer
334 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 ...
2
votes
1answer
193 views

How to make password protection with .htaccess file more user-friendly?

I have this in my .htaccess file: <FilesMatch "(contracts|concepts)$"> AuthName "Contracts" AuthType Basic AuthUserFile /is/htdocs/wp54963193_ZBG2Q9J2R8/www/.htpasswd ...
2
votes
1answer
15k views

Apache: Virtual Host and .htacess for URL Rewriting not working

I have configured a virtual host in my local machine and every thing is working fine. Now I want to use SEO friendly urls. To achieve this I have used the .htaccess file. My virtual host ...
2
votes
4answers
3k views

How to verify what modules are active on my server?

While trying to solve a problem on my website, a recommendation about my .htaccess file I got was First of all, please check on the server for all the different modules if they are enabled, ...
2
votes
1answer
886 views

=~ (equal-sign tilde) and m“ … ” in .htaccess directive

I saw this bit of code on an old forum post: SSLRequire %{HTTP_HOST} =~ m"\.secure\.powweb\.com" And I was just wondering what the =~ and m" ... " meant. I've been searching online and in the ...
2
votes
2answers
421 views

Restrict access to web directory with .htaccess

Let me just say that doing this sort of thing with .htaccess files has never been a strong point for me. Let's say that I have a directory in my web root: /dir/data Within that directory let's say ...
2
votes
1answer
733 views

How to stop access of a PHP file from other sites

I read somewhere about hot linking of images. Preventing image hot linking helps to stop bandwidth theft from your site. Would it work for a PHP file? In my case, I am using a PHP file to generate ...
2
votes
2answers
69 views

Unwanted redirect from a domain to my site

An external person from my client company registered a domain and redirected to my client URL. For instance, if you type unwanteddomain.com it redirects to myclientdomain.com. Is there any way to ...
2
votes
1answer
52 views

What do I put in htaccess to create a 410 error page when a URL parameter is present?

I tried to create a 410 error page but realized that I actually created a 302 redirect to a 410.php page. Instead I want to use a 410 error to block out an infinite number of dynamically created pages ...
2
votes
1answer
46 views

Rebranding: how do I redirect my website to a new domain, and blog to a subdomain?

I have a website that I am rebranding and using a new domain name for. Right now it is primarily a blog hosted at the root. I am going to be redirecting from www.old.com to www.new.com, and I also ...
2
votes
2answers
122 views

How to prevent JavaScript directory access with htaccess

I have a website like http://example.com but the problem with it is that people are able to get access to my JavaScript by pointing a browser to http://example.com/js/. I have little knowledge of ...