Skip to content
Tizards Briefcase

Category: Rewrite Rules

apache rewriterule: rewrite url to hash

October 25, 2012 Stuart Leave a comment

After building a new website for a client, i needed to redirect their old URLs to new ones, normally a…

Continue Reading →

Posted in: Apache, Rewrite Rules

creating html snapshots for google

October 18, 2012 Stuart Leave a comment

A recent project required that we use hash navigation for speedy access to content, this also eeded to be indexed…

Continue Reading →

Posted in: HTML, PHP, Rewrite Rules Filed under: html snapshots

force a trailing slash

August 25, 2012 Stuart Leave a comment

add a trailing slash to all URLs. [code]RewriteCond %{REQUEST_URI} /+[^\.]+$ RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L][/code]

Continue Reading →

Posted in: Apache, Rewrite Rules

using get variables

Stuart Leave a comment

This example changes /product.php?product_id=909 to /product?id=909 [code]RewriteCond %{QUERY_STRING} product_id=(.*) RewriteRule ^product.php(.*) /product?id=%1[/code]

Continue Reading →

Posted in: Rewrite Rules

remove www.

Stuart Leave a comment

remove the www. [code]RewriteCond %{HTTP_HOST} !^domain.com$ [NC] RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301][/code]

Continue Reading →

Posted in: Rewrite Rules

remove trailing slash

Stuart Leave a comment

[code]RewriteCond %{REQUEST_FILENAME}.php -f RewriteCond %{REQUEST_URI} !/$ RewriteRule (.*) $1\.php [L] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)/$ /$1 [R=301,L][/code]

Continue Reading →

Posted in: Rewrite Rules

force www.

Stuart Leave a comment

making sure all urls are beginning with the www. [code]RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L][/code]

Continue Reading →

Posted in: Rewrite Rules

Categories

  • Apache (12)
    • Rewrite Rules (7)
  • C# (1)
  • CSS (7)
  • dev testing (2)
  • HTML (6)
  • iPhone (1)
  • Javascript (15)
    • jQuery (9)
  • Linux (50)
    • mailservers (1)
    • Postfix (3)
    • vi (6)
  • Mac OS X (5)
  • MySQL (9)
  • Perl (5)
  • PHP (23)
    • CodeIgniter (1)
    • Cubex (1)
    • fuelPHP (9)
    • PHP Storm (1)
  • Plesk (16)
  • Python (1)
  • Ruby (5)
    • Hostpay (4)
  • unassigned (1)
  • Domain Availability Checker
Copyright © 2022 Tizards Briefcase — Lyrical WordPress theme by GoDaddy