/ / Alte URLs über htaccess - .htaccess zu neuen URLs umleiten

Alte URLs über htaccess - .htaccess an neue URLs umleiten

Ich habe derzeit eine Reihe von URLs, die ich zu ihren neuen URLs umleiten kann: Grundsätzlich muss ich "Blog" von Anfang an entfernen und dort das "Uri" hinzufügen:

redirect 301 /blog/posts/view/follow-twitter http://domain.net/posts/view/uri/follow-twitter

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

Dies ist der Rest des .htaccess, den ich habe:

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

Antworten:

3 für die Antwort № 1
RewriteRule ^blog/(.*)$ http://domain.net/uri/$1 [R=301]

bearbeiten:

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