How do I use mod_rewrite to change to ??

Is this possible?

Lets say I have this URL:

And I want to use mod_rewrite to make it look like:

Or is this not possible?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

If you define a rule per each string, yes. Because I can't see any pattern in your example to use a more flexible regular expression.

RewriteEngin on
# rewrit incomming request /3/ --> /1/2/3
Rewriterule ^3/$ /1/2/3/ [L]

are you planning to use that in a .htaccess file or in httpd.conf?
it should be
RewriteEngine on
(missing 'e')
GeesuAuthor Commented:
woa thats confusing, don't think I can do this myself...

Well basically what I need the rule to be like will depend on what is clicked on...  (I have a web archiving website)...

So one link will be:

which will be re-written as:

And the March-2006 and the 20 can change dynamically as well as the folder name for "thesitewillbehere", is this possible to do with a rule?
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

if you access you can rewrite it to (so exists physically) the other way /data/March-2006/20/thesitewillbehere/ exists but you're calling /thesitewillbehere/ will not work. You must use a RewriteMap or a rule for each string in that case.

RewriteEngine on
# /data/March-2006/20/thesitewillbehere/ --> /thesitewillbehere/
RewriteRule ^data/[^/]+/[^/]+/([^/]+)/$ /$1/ [L]
GeesuAuthor Commented:
Is it possible to have thesitewillbehere be the same???

In theory that directory is supposed to be the same each month this tool runs...  SO I guess I should try to make them different?

For example maybe doing like which I can then re-write as

These directories are created dynamically each month, so is it possible to auto-add a new rule everytime a directory is created?  Or is there a way to make this not necessary?
request of                                                      --> internally to --> or -->

would be possible. -->
RewriteRule ^([^-]+)-([0-9]+)-([0-9]+)-([^/]+)$ /data/$1-$3/$2/$4/ [L] -->
RewriteRule ^([^-]+-[0-9]+-[0-9]+-[^/]+)$ /data/$1 [L]

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GeesuAuthor Commented:
Wow dude thanks, I need to learn regular expressions it seems :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.