• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 330
  • Last Modified:

htaccess rewrite to chop out a portion of the url

Hi all,

I have another htaccess rewrite question. I want to "chop out" any portion to the left of the word "store" in a url.

The rewrite must only apply if "store" is in the url

EG:
www.domain.com/any-thing/store/thefile.htm must rewrite to www.domain.com/store/thefile.htm
www.domain.com/any-thing/blah/store/thefile.htm must rewrite to www.domain.com/store/thefile.htm

thanks

0
zattz
Asked:
zattz
1 Solution
 
ravenplCommented:
In the .htaccess file

Option +FollowSymLinks
RewriteEngine On
RewriteRule .+/store(.*) /store$1 [L]
#note, if You want the user to see the change in it's address bar, change [L] to [L,R=301]
0
 
zattzAuthor Commented:
Raven,

Thanks again for the help. Works perfectly.

Appreciate it :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now