jan_dembowski

SocialBlogsite htaccess file

Mar 27th, 2012
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <IfModule mod_rewrite.c>
  2. # Send old /blog URLs to the new location
  3. RewriteEngine On
  4. RewriteBase /
  5. # If the request exist as a real file or directory then ignore it
  6. RewriteCond %{REQUEST_FILENAME} !-f
  7. RewriteCond %{REQUEST_FILENAME} !-d
  8. # Ignore /blog without a trailing /
  9. RewriteCond %{REQUEST_URI} !blog$
  10. # Ignore requests with a trailing /
  11. RewriteCond %{REQUEST_URI} !([0-9].*)/$
  12. # Still here? Rewrite /blog/123 (no trailing slash)
  13. RewriteRule ^blog/([0-9].*)$ http://%{SERVER_NAME}/?p=$1 [R=301,L]
  14. #
  15. # If the request exist as a real file or directory then ignore it
  16. RewriteCond %{REQUEST_FILENAME} !-f
  17. RewriteCond %{REQUEST_FILENAME} !-d
  18. RewriteRule ^blog/(.*)\.html http://%{SERVER_NAME}/$1 [R=301,L]
  19. #
  20. # After all that rewrite any remaining /blog
  21. RewriteCond %{REQUEST_URI} !([0-9].*)/$
  22. RewriteRule ^blog/(.*) http://%{SERVER_NAME}/$1 [R=301,L]
  23. # Now continue on and let WordPress do it's thing
  24. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment