I'm migrating an old site to a new site and I want to redirect the oldsite.com homepage to newsite.com homepage. This is easy normally, but I also want to redirect oldsite.com/example to newsite.com/product/example. So basically I only want oldsite.com or www.oldsite.com to redirect to newsite.com, and not have the hompage url redirect to the newsite.com/product/ part. my htaccess is set up like this:
So pretty much anything on "oldsite.com/anything" redirects to "newsite.com/s=anything&post_type=product" I want this, but I also want oldsite.com to redirect to newsite.com and not newsite.com/s=&post_type=product How can I set this up?
My rewrite-fu is old and weak but it looks like someone else did that for me.
Luis Collins
This worked. Thank you you glorious bastard. Heres some more asians for you.
Brody Sullivan
RewriteEngine On RewriteCond %{HTTP_HOST} ^oldsite.com$ [NC] RewriteRule ^(.*)$ newsite.com/s=$1 [L,R=301]
Dominic Lewis
i didnt help but im lurking
Cooper Moore
...
Cooper Gutierrez
problem solved. Still will dump for awhile.
Benjamin Thomas
Any of these chicks got vids?
Camden Harris
No worries man. I've been doing this shit for so long, it barely requires thinking anymore. Glad it worked for you.
Juan Scott
...
Thomas Robinson
...
Brayden Ortiz
...
Kevin Sullivan
...
Adrian Murphy
...
Thomas Green
Bump
Jonathan Watson
dat pussy hair
Levi Ward
Who are you hosting on. If amazon then you could just use the Route 53 and route the old site to the new site. If not on amazon just change host.
Robert Anderson
I haven't used mod_rewrite since like 2008. Every app I write these days just uses the routing modules built into the tech stack
Isaac Moore
Also is this client work? You should brush up on your regexes then dude, you're gonna need it again in the future.
Juan Reed
Since uve been doing this for a while can u give me tips on where to get started to learn web programming?
Ryan Collins
I suspect this is just the leaving-behind-a-stub portion of the program. >also router masterrace
The web, of course. Set up a web server on your machine. Read everything you can get your hands on. Above all, experiment, and expect to spend a good few hundred hours gittin gud.
Jason Smith
Mo
Asher Foster
I mean, obviously the web but I wanted to know maybe certain website or even book I can read to as a noob
Henry Jones
wc3schools.com
Gabriel Long
lol
Bentley Sanchez
developer.mozilla.com is alright for the frontend part of it and has a few tutorials. Backend stuff, pretty much just read the docs front to back and experiment. Search engines are your friend because there are a hundred ways to do some things and each has their tradeoffs.