[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Coder fags, I need your help. I'm migrating an old sit

This is a red board which means that it's strictly for adults (Not Safe For Work content only). If you see any illegal content, please report it.
The stories and information posted here are artistic works of fiction and falsehood.
Only a fool would take anything posted here as fact.

Thread replies: 55
Thread images: 35

File: CXZ66TL.jpg (74KB, 800x967px) Image search: [Google]
CXZ66TL.jpg
74KB, 800x967px
Coder fags, I need your help.

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:

RewriteEngine On

RewriteBase /
RewriteCond %{HTTP_HOST} ^oldsite\.com$ [NC]
RewriteRule ^(.*)$ https://www.newsite.com/s=$1&post_type=product [R=301,L]

RewriteBase /
RewriteCond %{HTTP_HOST} ^www.oldsite\.com$ [NC]
RewriteRule ^(.*)$ https://newsite.com/s=$1&post_type=product [R=301,L]

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?

Dumping my asian folder for help.

Thanks plebs.
>>
File: 2fac7b10b3e94625afcad8266e1838e2.jpg (118KB, 768x1024px) Image search: [Google]
2fac7b10b3e94625afcad8266e1838e2.jpg
118KB, 768x1024px
>>
>>
File: EiNxbB6.jpg (148KB, 771x634px) Image search: [Google]
EiNxbB6.jpg
148KB, 771x634px
>>
>>>/g/
>>
File: etY4lWj.jpg (59KB, 720x960px) Image search: [Google]
etY4lWj.jpg
59KB, 720x960px
>>
Got a mega folder?
>>
File: fFrjkG6.jpg (207KB, 1082x961px) Image search: [Google]
fFrjkG6.jpg
207KB, 1082x961px
>>745030648
Shutup faggot and enjoy the asians
>>
File: jlrVj48.jpg (356KB, 1280x1708px) Image search: [Google]
jlrVj48.jpg
356KB, 1280x1708px
>>
File: JQ8JECs.jpg (88KB, 500x637px) Image search: [Google]
JQ8JECs.jpg
88KB, 500x637px
>>
>>745030721
do you want help or not, retard?
>>
File: MfS3TTr.jpg (110KB, 853x1280px) Image search: [Google]
MfS3TTr.jpg
110KB, 853x1280px
>>
File: nqRRrjJ.jpg (10KB, 500x375px) Image search: [Google]
nqRRrjJ.jpg
10KB, 500x375px
>>
File: onPsR1I.jpg (143KB, 1059x1200px) Image search: [Google]
onPsR1I.jpg
143KB, 1059x1200px
>>
File: OQVf5le.jpg (261KB, 2048x3072px) Image search: [Google]
OQVf5le.jpg
261KB, 2048x3072px
>>
File: ptO2Khb.jpg (103KB, 1080x1350px) Image search: [Google]
ptO2Khb.jpg
103KB, 1080x1350px
>>
more asian girls plz
>>
File: BdMqF9f.jpg (61KB, 750x937px) Image search: [Google]
BdMqF9f.jpg
61KB, 750x937px
>>
File: dPdIKid.jpg (111KB, 1080x1239px) Image search: [Google]
dPdIKid.jpg
111KB, 1080x1239px
my favy plz help wit da kode
>>
File: 1484104947194.jpg (604KB, 3456x5184px) Image search: [Google]
1484104947194.jpg
604KB, 3456x5184px
>>
File: dYYm7DP.jpg (101KB, 960x1200px) Image search: [Google]
dYYm7DP.jpg
101KB, 960x1200px
>>
File: e61abdadb7fd48acb996f6a4fe1e666a.jpg (120KB, 1024x1024px) Image search: [Google]
e61abdadb7fd48acb996f6a4fe1e666a.jpg
120KB, 1024x1024px
>>
>>745031069
you could have at least cross posted on >>>/g/, you dumb nigger.
>b-but /b/ is only board I know durrrr
>>
File: JtkiJWz.jpg (90KB, 720x900px) Image search: [Google]
JtkiJWz.jpg
90KB, 720x900px
>>
File: ffffffuck.gif (858KB, 200x267px) Image search: [Google]
ffffffuck.gif
858KB, 200x267px
>>745030594
Sorry never done any web programming
>>
>>745030997
>double chest zipper
Someone has thought of that. Cheers to them.

>>745030594
Change the regex to something a little more substantial, like
^/(.+)$
and add another rewrite rule for
^/?$
for the main page.
>>
File: MAMbU1w.jpg (82KB, 620x620px) Image search: [Google]
MAMbU1w.jpg
82KB, 620x620px
>>
File: nJgIfze.jpg (77KB, 1080x1350px) Image search: [Google]
nJgIfze.jpg
77KB, 1080x1350px
>>745031218
Can you elaborate a little more? maybe with an example?
>>
RewriteCond %{HTTP_HOST} ^(www\.)?oldsite\.com$ [NC]
RewriteRule ^(/)?$ https://newsite.com [R=301,L]

RewriteCond %{HTTP_HOST} ^(www\.)?oldsite\.com$ [NC]
RewriteRule ^(.*)$ https://newsite.com/s=$1&post_type=product [R=301,L]
>>
File: qBTx8Zy.jpg (150KB, 725x1200px) Image search: [Google]
qBTx8Zy.jpg
150KB, 725x1200px
>>
>>745031363
My rewrite-fu is old and weak but it looks like someone else did that for me.
>>
File: vCLVLwS.jpg (110KB, 1080x1285px) Image search: [Google]
vCLVLwS.jpg
110KB, 1080x1285px
>>745031385
This worked. Thank you you glorious bastard. Heres some more asians for you.
>>
>>745030594
RewriteEngine On
RewriteCond %{HTTP_HOST} ^oldsite.com$ [NC]
RewriteRule ^(.*)$ https://newsite.com/s=$1 [L,R=301]
>>
>>745031613
i didnt help but im lurking
>>
File: tumblr_ow2ns0I6Li1vu274po1_1280.png (418KB, 644x1066px) Image search: [Google]
tumblr_ow2ns0I6Li1vu274po1_1280.png
418KB, 644x1066px
>>
File: R1oPXFV.jpg (155KB, 996x747px) Image search: [Google]
R1oPXFV.jpg
155KB, 996x747px
problem solved. Still will dump for awhile.
>>
Any of these chicks got vids?
>>
>>745031613

No worries man. I've been doing this shit for so long, it barely requires thinking anymore. Glad it worked for you.
>>
File: qljohEq.jpg (64KB, 959x960px) Image search: [Google]
qljohEq.jpg
64KB, 959x960px
>>
File: q7Xumm5.jpg (92KB, 500x750px) Image search: [Google]
q7Xumm5.jpg
92KB, 500x750px
>>
File: CHobMd8.jpg (97KB, 1080x1199px) Image search: [Google]
CHobMd8.jpg
97KB, 1080x1199px
>>
File: 793354ea9a5c7797e1156ead5d719f06.jpg (204KB, 900x1157px) Image search: [Google]
793354ea9a5c7797e1156ead5d719f06.jpg
204KB, 900x1157px
>>
File: n2lrygOg5g1rhc8ino1.jpg (94KB, 500x714px) Image search: [Google]
n2lrygOg5g1rhc8ino1.jpg
94KB, 500x714px
>>
File: Sora_Aoi_00147627.jpg (185KB, 885x1249px) Image search: [Google]
Sora_Aoi_00147627.jpg
185KB, 885x1249px
Bump
>>
File: da_phuc.jpg (13KB, 480x468px) Image search: [Google]
da_phuc.jpg
13KB, 480x468px
>>745033211
dat pussy hair
>>
>>745030594
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.
>>
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
>>
Also is this client work? You should brush up on your regexes then dude, you're gonna need it again in the future.
>>
>>745031958
Since uve been doing this for a while can u give me tips on where to get started to learn web programming?
>>
>>745033505
I suspect this is just the leaving-behind-a-stub portion of the program.
>also router masterrace

>>745034040
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.
>>
File: 1 (72).jpg (2MB, 2448x3264px) Image search: [Google]
1 (72).jpg
2MB, 2448x3264px
Mo
>>
>>745034224
I mean, obviously the web but I wanted to know maybe certain website or even book I can read to as a noob
>>
>>745034412
wc3schools.com
>>
>>745034412
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.
>>
Thread posts: 55
Thread images: 35


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.