NetMedia
NetMedia

Reputation: 1

Rewrite 301 page with parameter

I've looked the whole tutorials about htaccess and I can't find how to figure out my issue :

I want to redirect 301 this page :

welcome-user-32.htm 

to

welcomeback-32.htm

the 32 is a user id that change from user to another accordingly...

I tried this but didnt success :

RewriteRule welcome-user-(.*)\.htm$ welcomeback-(.*)\.htm$ [L,R=301]

Thanks for taking the time to read my isse, I hope someone can help !

Regards

Upvotes: 0

Views: 23

Answers (1)

Mohammed Elhag
Mohammed Elhag

Reputation: 4302

Try this code :

RewriteEngine On
RewriteRule (welcome\-user\-)(.*)\.htm  /welcomeback-$2.htm [R=301,L]

Upvotes: 1

Related Questions