redirect .htaccess - remove last part of url

Jan Doleží

I need redirect url like: www.domain.com/xx/yy/itinerar to www.domain.com/xx/yy. The value of yy can be various. I have

RewriteCond %{REQUEST_URI} (.*)itinerar

but i have trouble with RewriteRule.

anubhava

You can use this redirect rule:

RewriteEngine On

RewriteRule ^(.*)/itinerar/?$ /$1 [L,NC,R=301]

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Change and remove a part of url with redirect 301 (htaccess)

remove a specific part from url with htaccess and redirect

How to remove last part of my URL with .htaccess?

.htaccess redirect URL last part to same URL query strings value?

Redirect htaccess part of url

.htaccess redirect loop when trying to transform last part of URL to fragment

Need to redirect last part of url using htaccess with parameters

How to redirect to clean URL (remove last hypen) with RewriteRule in .htaccess

htaccess - redirect removing part of url

.htaccess redirect based on a part of URL

htaccess remove ? from the url and redirect

.htaccess - How to remove part of url?

Redirect via htaccess and remove part of link

How to remove the last part of url?

.htaccess redirect only working for part of the URL

Capture the last subfolder of the URL to redirect using htaccess

htaccess rewrite - removing the last part from url

htaccess remove www redirect to ssl but wrong url

.htaccess redirect remove "?_route_=" form URL

How to remove part of a url using htaccess

How to remove the last part of a string url in PHP

How to remove last part of url in PHP

Remove url and leave only last part of it

nginx rewrite url and remove last part

Htaccess 301 redirect by stripping part of string url to correct url

Redirect all urls after replace a part of url htaccess

.htaccess - check if part of URL is missing - 301 redirect for ajax URLS

How to 301 redirect by changing part of a dynamic url in htaccess

. htaccess - redirect to subfolder with HTTPS while hiding URL part