This link has been bookmarked by 451 people . It was first bookmarked on 24 Apr 2006, by vivpuri.
-
24 Nov 14
borfer.htaccess files. cool htaccess tricks and tips, how-to, know-how and examples.. a corz-style tutorial.
-
10 May 14
-
21 Sep 13
-
29 Jan 13
-
09 Jan 13
-
13 Dec 12
-
07 Nov 12
-
02 Oct 12
-
23 Sep 12
-
18 Sep 12
-
26 Jun 12
-
11 Jun 12
Rodolfo ArceHtaccess apache rewrite tips and tricks
apache rewrite tips example examples httpd http programming php
-
07 May 12
-
05 May 12
-
27 Feb 12
-
15 Jan 12
-
11 Jan 12
-
10 Jan 12
-
03 Jan 12
-
15 Dec 11
-
09 Nov 11
-
06 Nov 11
-
29 Oct 11
-
12 Oct 11
-
In the following example, the RewriteCond statement checks that the query string has the foo variable set, and captures its value while it's there. In other words, only requests for /grab that have the variable foo set, will be rewritten, and while we're at it, we'll also switch foo, for bar, just because we can..
-
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{QUERY_STRING} foo=(.*)
RewriteRule ^grab(.*) /page.php?bar=%1 -
would translate a link/user's request for..
http://domain.com/grab?foo=bar
server-side, into..
http://domain.com/page.php?bar=bar
-
-
06 Oct 11
-
27 Sep 11
-
19 Sep 11
-
23 Aug 11
-
06 Aug 11
-
21 Jul 11
-
20 Jul 11
-
07 Jul 11
-
21 May 11
-
lder rule, highlighted in red. you must add the current path to the new rule. now it works again, and all the osx/ subfolders will be covered b
-
-
12 May 11
-
10 May 11
-
09 May 11
-
07 May 11
-
05 May 11
-
27 Apr 11
-
23 Apr 11
-
01 Apr 11
-
18 Mar 11
-
10 Mar 11
-
07 Mar 11
-
17 Feb 11
-
16 Feb 11
-
14 Jan 11
-
11 Jan 11
-
30 Dec 10
-
27 Dec 10
-
19 Dec 10
-
13 Dec 10
-
08 Dec 10
-
23 Nov 10
-
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.+)\.htm$ http://corz.org/$1.php [R,NC]
-
-
10 Nov 10
-
04 Nov 10
-
29 Oct 10
-
27 Oct 10
Matteo Gasguida completa a .htaccess
howto tutorial html htaccess webdev for:mulp for:roberto.pierpaoli for:1000anni for:roberta_dudat
-
13 Oct 10
-
30 Sep 10
-
27 Sep 10
-
21 Sep 10
-
15 Sep 10
-
14 Sep 10
-
08 Sep 10
-
20 Aug 10
-
16 Aug 10
Nidal Al HaririRewriteRule ^files/([^/]+)/([^/]+).zip /download.php?section=$1&file=$2 [NC]
-
12 Aug 10
-
27 Jul 10
-
23 Jul 10
-
14 Jul 10
-
Ian Gray.htaccess tricks and tips Part 2
htaccess mod_rewrite apache howto tutorial web webdev tips mod+rewrite
-
01 Jul 10
-
24 Jun 10
-
22 Jun 10
-
11 Jun 10
-
07 Jun 10
-
Whenever you use mod_rewrite (the part of Apache that does all this magic), you need to do..
you only need to do this once per .htaccess file:Options +FollowSymlinks
RewriteEngine on
..before any ReWrite rules. note: +FollowSymLinks must be enabled for any rules to work, this is a security requirement of the rewrite engine. Normally it's enabled in the root and you shouldn't have to add it, but it doesn't hurt to do so, and I'll insert it into all the examples on this page, just in case*.
The next line simply switches on the rewrite engine for that folder. if this directive is in you main .htaccess file, then the ReWrite engine is theoretically enabled for your entire site, but it's wise to always add that line before you write any redirections, anywhere.
-
-
12 May 10
-
11 May 10
-
07 May 10
-
06 May 10
-
03 May 10
-
30 Apr 10
Chris Markle.htaccess files. cool htaccess tricks and tips, how-to, know-how and examples.. a corz-style tutorial.
-
28 Apr 10
-
26 Apr 10
-
18 Apr 10
-
09 Apr 10
-
06 Apr 10
-
04 Apr 10
-
29 Mar 10
-
RewriteRule ^(.+)\.htm$ http://corz.org/$1.php [R,NC] -
This time we instruct mod_rewrite to do a proper external rewrite, aka, "redirection". N
-
and so will you; using this technique, you can move /public/files/download/ to anywhere else in your site, and all the old links still work fine;
-
RewriteCond is very like doing if...then...do in many programming languages. If a certain condition is true, then do the rewrite that follows..
-
only requests for /grab that have the variable foo set, will be rewritten, and while we're at it, we'll also switch foo, for bar, just because we can..
-
-
prevent the "www" part showing up at my si
-
In fact, I recently updated it so that I could share rules between my dev mirror and live site without any .htaccess editing..
-
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,NC,L] -
our guests don't, here's a neat way to have the wonderful Google translator provide automatic on-the-fly translation for your site's pag
-
: Use [R] instead of [R=301] while you are testing .
-
-
25 Mar 10
-
24 Mar 10
-
11 Mar 10
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.