× Here you can get community support related to ReDJ.

Remove number from URL and redirect

  • lablett
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 weeks ago #3255 by lablett
Remove number from URL and redirect was created by lablett
Hi there,

I want to create a generic redirect and remove the ID's from all the URLS.

The following example shows the original URL

www.oaktreebrides.co.uk/wedding-dresses/size-10/377-white-one-norman

Below is the redirect I want

www.oaktreebrides.co.uk/wedding-dresses/size-10/white-one-norman

I'm slightly confused about macros and place holders so what approach should I use ?

Lee

Please Log in or Create an account to join the conversation.

  • lablett
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 weeks ago #3256 by lablett
Replied by lablett on topic Remove number from URL and redirect
ok I think I am getting my head around things but the match is not working

I have :-

From URL /wedding-dresses/size-10/(.*)-white-one-norman

To URL http://{siteurl}/wedding-dresses/size-10/{preg_match}/wedding-dresses/size-10/377-(.*)${/preg_match}

Please Log in or Create an account to join the conversation.

  • lablett
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 weeks ago #3257 by lablett
Replied by lablett on topic Remove number from URL and redirect
ok got it working and below are my settings:-

FROM URL :-
/wedding-dresses/size-[0-9]+/[0-9]+-.*

To URL
http://{siteurl}/wedding-dresses/size-${size}/${dress}


Place holders:-
dress={preg_match 2}/wedding-dresses\/size-(.*)\/[0-9]+-(.*)/i{/preg_match}
size={preg_match 1}/wedding-dresses\/size-(.*)\/[0-9]+-(.*)/i{/preg_match}

Please Log in or Create an account to join the conversation.

More
10 years 3 weeks ago #3262 by admin
Replied by admin on topic Remove number from URL and redirect
Hi,
this is a dream that comes true... great!!!

Just one note to make this rule "perfect":
From URL: ^/wedding-dresses/size-[0-9]+/[0-9]+-
To URL: {scheme}://{siteurl}/wedding-dresses/size-${size}/${dress}

The caret ^ means "start with" so we restrict the matching URLs. The final .* is not strictly necessary (a partial matches is supported). And the {scheme} in the destination allows the rule to work also for https requests, and Google started to love https on sites...

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

  • lablett
  • Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 3 weeks ago #3264 by lablett
Replied by lablett on topic Remove number from URL and redirect
Luigi,

Thanks for the additional bits and they worked a treat ;-)

I was thinking of switching to to https for google improvement, is it worth while ?

Many thanks

Lee

Please Log in or Create an account to join the conversation.

More
10 years 3 weeks ago #3270 by admin
Replied by admin on topic Remove number from URL and redirect
You could enable the https and be ready for Google (like I did on this site), but I am not sure is safe regarding pageranks and back links, Google itself considers http and https as different sites...

My suggestion is to prepare the site and leave both access free..

Kind regards,
Luigi

Please Log in or Create an account to join the conversation.

Time to create page: 0.134 seconds