.htaccess tutorial

htaccess Elite


Rewrite Moved Directory

Ask your mod_rewrite and Redirection questions here, and get answers!

Rewrite Moved Directory

New postby willyfoo » 25 Apr 2008 12:19

Using wordpress I renamed the 'category' to 'blog' and i'm trying to redirect

http://livestudios.sg/category/photocards to http://livestudios.sg/blog/photocards
but it doesn't seem to work.. what am I missing?

Code: Select all
DirectoryIndex index.shtml index.php3 index.html index.htm index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond ${REQUEST_URI} ^.*/category/.*
RewriteRule ^/category/([A-Za-z0-9]+)$ /blog/$1 [R]
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
willyfoo
 
Posts: 2
Joined: 25 Apr 2008 11:50

Re: Rewrite Moved Directory

New postby mod_rewrite » 09 May 2008 23:05

Code: Select all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^GET\ /category/(.*)\ HTTP/
RewriteRule .* http://livestudios.sg/blog/%1 [R=301,L]

RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>


Does that work?
mod_rewrite
 
Posts: 102
Joined: 30 Oct 2006 19:55

Re: Rewrite Moved Directory

New postby willyfoo » 10 May 2008 00:48

mod_rewrite wrote:
Code: Select all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^GET\ /category/(.*)\ HTTP/
RewriteRule .* http://livestudios.sg/blog/%1 [R=301,L]

RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>


Does that work?


It worked!!! You're a savior!!!!

http://livestudios.sg/category/highlights
willyfoo
 
Posts: 2
Joined: 25 Apr 2008 11:50


Return to Redirect or Rewrite Questions