Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <IfModule mod_rewrite.c>
- # Send old /blog URLs to the new location
- RewriteEngine On
- RewriteBase /
- # If the request exist as a real file or directory then ignore it
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- # Ignore /blog without a trailing /
- RewriteCond %{REQUEST_URI} !blog$
- # Ignore requests with a trailing /
- RewriteCond %{REQUEST_URI} !([0-9].*)/$
- # Still here? Rewrite /blog/123 (no trailing slash)
- RewriteRule ^blog/([0-9].*)$ http://%{SERVER_NAME}/?p=$1 [R=301,L]
- #
- # If the request exist as a real file or directory then ignore it
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^blog/(.*)\.html http://%{SERVER_NAME}/$1 [R=301,L]
- #
- # After all that rewrite any remaining /blog
- RewriteCond %{REQUEST_URI} !([0-9].*)/$
- RewriteRule ^blog/(.*) http://%{SERVER_NAME}/$1 [R=301,L]
- # Now continue on and let WordPress do it's thing
- </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment