tom84
tom84

Reputation: 401

change url alias via htaccess and mod rewrite?

I want to change an url-alias via htaccess. Here is one example, how one url should be changed:

original url:

www.domain.de/immobilien-vermarktungsart/miete

future url:

www.domain.de/immobilien-leipzig/mieten

Is it possible only to change the url-alias?

Upvotes: 0

Views: 216

Answers (1)

arkascha
arkascha

Reputation: 42885

The discussion reveals that you are looking for a combination of an external and an internal rewriting:

RewriteEngine on
RewriteBase /
RewriteRule ^/?immobilien-vermarktungsart/miete(.*)$ /immobilien-leipzig/mieten$1 [R=301,QSA]
RewriteRule ^/?immobilien-leipzig/mieten(.*)$ /immobilien-vermarktungsart/miete$1 [END,QSA]

This will change the visible URL in the broser from immobilien-vermarktungsart to immobilien-leipzig, but internally still deliver the contents of immobilien-vermarktungsart.

Upvotes: 1

Related Questions