Replace substring in URL
3 posts
• Page 1 of 1
- paulryanwelch
-
- Posts: 5
- Joined: 05 Dec 2012, 01:00
Replace substring in URL
Hello. I need to be able to replace a substring in an incoming url. Example: if the url has "northwest-suburbs" anywhere in it, I need that substring to be replaced with "northwest-chicago-suburbs".
Many thanks in advance!
Many thanks in advance!
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Replace substring in URL
Hello,
Please, try using the following:
Regards
Andrew
Please, try using the following:
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} ^/(.*)northwest-suburbs(.*)$ [NC]
RewriteRule .* /%1northwest-chicago-suburbs%2 [NC,R=301,L]
Regards
Andrew
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 16 guests