开发者

Redirect Old urls to new urls via htaccess

开发者 https://www.devze.com 2023-02-01 22:01 出处:网络
I currently have a bunch of urls to redirect to their new urls: I basically have to remove \'blog\' from the start and add the \'uri\' in there:

I currently have a bunch of urls to redirect to their new urls: I basically have to remove 'blog' from the start and add the 'uri' in there:

redirect 301 /blog/posts/view/follow-twitter ht开发者_Python百科tp://domain.net/posts/view/uri/follow-twitter

redirect 301 /blog/posts/view/around-the-corner http://domain.net/posts/view/uri/around-the-corner

This is the rest of the .htaccess I have:

Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php


RewriteRule ^blog/(.*)$ http://domain.net/uri/$1 [R=301]

edit:

RewriteRule ^blog/posts/view/(.*)$ http://domain.net/posts/view/uri/$1 [R=301]
0

精彩评论

暂无评论...
验证码 换一张
取 消