× Here you can get community support related to ReDJ.

Remove part of the url

  • tenntim
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 1 week ago #3798 by tenntim
Remove part of the url was created by tenntim
I have slightly changed the URL structure of my site and need to redirect the old links.

Old Structure:
example.com/index.php/en/front-page/leagues/college/alabama/alabama-gray-string-pack-detail

New Structure:
example.com/index.php/front-page/leagues/college/alabama/alabama-gray-string-pack-detail

Is there a way to create a single rule that will take care of this? What does it need to look like, and what settings do I need to create in that rule? Basically, I no longer use the "/en" in the middle of the URL structure and have removed it...just need all the indexed links on google to redirect here.

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

More
9 years 1 week ago #3801 by admin
Replied by admin on topic Remove part of the url
Hi.
Not sure if the presence of index.php can be a problem (never tried) but try this:
From URL: ^/index\.php/en/
To URL: {scheme}://{siteurl}/index.php/{pathltrim /index.php/en/}{queryfull}
Request only: true (checked)

Kind regards,
Luigi

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

  • tenntim
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 1 week ago #3803 by tenntim
Replied by tenntim on topic Remove part of the url
Thanks so much!

What if I also want to remove the "index.php" from the url. I have now adjusted the url to be example.com/front-pages/...etc. Not sure still how to adjust the rule to accomodate this change.

By the way, your code above does work, but leaves the index.php...which I have since removed from the link structure

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

More
9 years 1 week ago #3805 by admin
Replied by admin on topic Remove part of the url
If you change your SEF configuration to remove the index.php from your URLs, then you can redirect all old URLs changing the previous rule as follow:
From URL: ^/index\.php/en/
To URL: {scheme}://{siteurl}{pathltrim /index.php/en/}{queryfull}
Request only: true (checked

Kind regards,
Luigi

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

  • tenntim
  • Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 1 week ago #3806 by tenntim
Replied by tenntim on topic Remove part of the url
Strange it is still redirecting to the url that has "index.php" included

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

More
9 years 1 week ago #3807 by admin
Replied by admin on topic Remove part of the url
Try to empty browser cache.

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

Time to create page: 0.101 seconds