Remove part of the url
-
tenntim
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 4
-
Thank you received: 0
-
-
10 years 8 hours ago #3798
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.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
9 years 11 months ago #3801
by admin
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
-
Less
More
-
Posts: 4
-
Thank you received: 0
-
-
9 years 11 months ago #3803
by tenntim
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.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
9 years 11 months ago #3805
by admin
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
-
Less
More
-
Posts: 4
-
Thank you received: 0
-
-
9 years 11 months ago #3806
by tenntim
Strange it is still redirecting to the url that has "index.php" included
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 3194
-
Thank you received: 441
-
-
Time to create page: 0.145 seconds