Forum Moderators: phranque
Options +FollowSymlinks
RewriteRule ^/customer$ /shop/customer/ [R]
RewriteRule ^/customer(.+) [domain.net...] [R,L]
RewriteRule ^customer/$ /shop/customer/$1
thats what i tried so far...
Options +FollowSymlinks
RewriteEngine On
#
RewriteRule ^/customer(.+) http://www.example.com/shop/customer/$1 [R,L]
2) The pattern "customer(.+)" requires at least one character to follow "customer".
3) The [R] flag, specified without an argument, defaults to a 302-Found redirect; Search engines will keep the old URL in their database, and not update it to reflect the new URL.
With a few additional tweks for 'neatness', try this:
Options +FollowSymlinks
RewriteEngine on
#
RewriteRule ^customer(/.*)?$ http://www.example.com/shop/customer$1 [R=301,L]
Jim
Leading / on pattern is needed only if the code goes in httpd.conf. Omit the / if the code is in .htaccess.
The R flag should specify R=301 otherwise you get a 302 redirect.
Your third rule uses the $1 backreference which is undefined. There is no () construct in the pattern.
The third rule will never be processed as the second rule will already have matched and sent the user to
http://www.domain.net/shop/customer[b]//[/b]. There are a lot of issues to address in the sample code.