Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

how to redirect _AE123.html URLs to WP extensionless

         

alexod

4:04 pm on Apr 19, 2023 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi Team,

My client had a html website, that we decided to convert to CMS/Wordpress. After convertion we get another problem - URLs

Old website's URLs had such a structure

https://example.com/Arrest-Me-There-_AE888.html
https://example.com/post-title-name-_AE858.html
https://example.com/another-post-title-name-_AE155.html

so at the end of URL

-_AE(number)(number)(number).html
or
_AE(number)(number)(number).html
or
._AE(number)(number)(number).html

on wordpress I keep the same keywords in slugs, but without those extensions at the end

https://example.com/arrest-me-there/

-
unfortunately we have >1900 URLs that need to be redirected, so it's impossible to do one by one.

I tried to run thru redirection plugin

 
^/(.*?)\.html$

/$1/


but this don't fix the issue with "-_AE***"

Please advice what other command I can run to /remove/ and redirect URLs to new pages.

-_AE***.html

Thanks



[edited by: not2easy at 5:22 pm (utc) on Apr 19, 2023]
[edit reason] For readability, please use 'example.com' [/edit]

phranque

7:14 pm on Apr 19, 2023 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



if you are on an Apache server with mod_rewrite enabled, you should be able to accomplish this with a single RewriteRule directive in the .htaccess file.

you can also accomplish this by enabling and using regular expressions in the Redirection WP plugin.

jawad

5:26 pm on May 15, 2023 (gmt 0)



If you convert your website to the wordpress then you can use redirection plugin to redirect your all URL's/

lucy24

6:44 pm on May 15, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You may be more likely to get a useful answer if you post in the Apache subforum.

When redirecting in a WP site, make sure all rules involving redirects are located before the WP-internal rules. (This would probably happen anyway, since external redirects normally go before internal rewrites.)