Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » How do I…?
  3. » URL Rewrite

#1 2008-09-18 19:53:20

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

URL Rewrite

RewriteEngine On
RewriteCond %{HTTP_HOST} ^simplecandy.com
RewriteRule (.*) http://www.simplecandy.com/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*) index.php

I’m using this at the moment to make all queries at my site HAVE the WWW beforehand.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

This is slightly different to my original code, as it adds a \ and a $ [NC]
What does this offer over my original code? Thanks yet again. x

Last edited by driz (2008-09-18 20:19:25)


~ Cameron

Offline

#2 2008-09-18 20:51:31

TheEric
Plugin Author
From: Wyoming
Registered: 2004-09-17
Posts: 566

Re: URL Rewrite

http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html

Offline

  1. Index
  2. » How do I…?
  3. » URL Rewrite

Board footer

Powered by FluxBB