Avatar of soyglobal
soyglobal
 asked on

how rewrite old urls to new format

Hello, i have this url format
http://www.domain.com/index.php/transportes-mainmenu-16/10-transportes/32305-title-page-masivas.html

and i want rewrite to this
http://www.domain.com/title-page.html
How i can do it?
Thanks
Apache Web ServerWordPress

Avatar of undefined
Last Comment
soyglobal

8/22/2022 - Mon
sweetfa2

First you have to install the mod_rewrite package

Install ModRewrite

Apache Mod_rewrite

in your httpd.conf, or another .conf file in your /etc/apache2/conf.d directory add the command
RewriteRule ^/index.php/transportes-mainmenu-16/10-transportes/32305-title-page-masivas.html http://www.domain.com/title-page.html

Open in new window

soyglobal

ASKER
You don't understand me,
transportes-mainmenu-16= is variable, but mandatory (always exist)
10-transportes= is variable, but optional, can exist or not
32305-title-page-masivas= is variable, the number and the title
Them your example not is valid to me

I know rewrite fixed elements, but not variable elements
Francis Omoruto

Can't you change the code that generates the variable URLs?
If it is code that generates the URLs, add a lookup table to standardize the result!

I assume that the resulting URL is also variable, not static.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER CERTIFIED SOLUTION
soyglobal

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
soyglobal

ASKER
I found the solution and any answer is related to my problem