Dan
Dan

Reputation: 71

.htaccess question

Recently changed CMS from jShop to Drupal and because jShop uses sessions I am getting a lot of visitors to my website through pages like these :-

page.php/privacypolicy/a9d08247d84a70a425dccf15e7e1f61b
page.php/privacypolicy/3091d422e0d5a61328329979dab8f10f

As you can see, the session ID is always changing so I'm having trouble redirecting the old private policy page to the new one using .htaccess.

Is there any way I can ignore the last part of the URL and force it to redirect anything that is page.php/privatepolicy/?

Upvotes: 0

Views: 64

Answers (1)

Shef
Shef

Reputation: 45589

Try:

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine on

    # page.php/privacypolicy/abcd123... -> private-policy
    RewriteRule page\.php/privacypolicy.+ private-policy [R=301,L]

</IfModule>

Upvotes: 1

Related Questions